body {
    background: url('background.png') no-repeat center center fixed;
    background-size: cover;
    margin: 0; font-family: sans-serif;
}

/* --- Explorer Window --- */
.window {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 90%;       /* 画面の80%を使う */
    height: 80vh;     /* 画面の高さの70%を使う */
    background: #ffffff;
    border: 1px solid #1c1c1c;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    z-index: 100;
}

.window-header {
    background: #f3f3f3; /* モダンな薄いグレー */
    color: #333;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
}

.close-btn {
    cursor: pointer;
    padding: 5px 10px;
    background: #ff5f56; /* 閉じるボタンを赤くしてアクセントに */
    color: white;
    border-radius: 3px;
    font-size: 12px;
}

/* --- Explorer Controls (Headers) --- */
.explorer-controls {
    display: flex;
    background: #fafafa;
    border-bottom: 1px solid #ddd;
}

.sort-header {
    padding: 12px 20px;
    cursor: pointer;
    flex: 1;
    border-right: 1px solid #eee;
    font-size: 16px; /* 文字を大きく */
    font-weight: 600;
    color: #555;
}

.sort-header:hover {
    background: #f0f0f0;
}

/* --- File List Body --- */
.window-body {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.file-item {
    display: flex;
    align-items: center;
    /* 上下のパディングを 25px にして、一行の厚みを出すよ */
    padding: 25px 40px; 
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s; /* 少し動く演出を追加 */
}

.file-item:hover {
    background: #f5faff;
}

.file-icon {
    font-size: 40px; /* アイコン（📄）を特大に！ */
    margin-right: 30px;
}

.file-name {
    flex: 1;
    font-size: 30px; /* ファイル名を 24px までアップ */
    font-weight: 500;
    color: #1a1a1a;
}

.file-date {
    color: #999;
    font-size: 20px; /* 日付も 20px にして読みやすく */
    width: 200px;
    text-align: right;
}
/* --- Desktop Icons --- */
/* --- Desktop Icons --- */
/* --- Desktop Layout --- */
#desktop {
    width: 100vw;
    height: 100vh;
    position: relative; /* 絶対配置の基準にする */
    overflow: hidden;
    display: flex; /* アイコンを並べるため */
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
}

/* 窓が閉まっている時は絶対にクリックを邪魔させない */
.window {
    display: none; /* JSで制御するけど、初期値も大事 */
    position: absolute;
    z-index: 100;
}

/* --- Desktop Icons (統合版) --- */
.icon {
    width: 140px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    text-shadow: 2px 2px 4px black;
    margin: 20px;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.2s, border 0.2s;
    border: 1px solid transparent; /* 枠線を常に確保しておく */
    -webkit-tap-highlight-color: transparent;
}

/* 通常のホバー（選択されていない時） */
.icon:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ★最優先：選択された時の青い光 */
/* クラスを繋げて書くことで、上のhoverよりも論理的に強くする */
.icon.selected {
    background-color: rgba(0, 120, 215, 0.4) !important;
    border: 1px solid rgba(0, 120, 215, 0.6) !important;
    border-radius: 3px;
}

.icon img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    pointer-events: none; /* 画像をクリックしても親の.iconが反応するようにする */
}

.icon span {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    word-break: break-all;
    pointer-events: none; /* 文字をクリックしても親の.iconが反応するようにする */
}

/* --- Window Layout --- */
.file-item {
    display: flex;
    align-items: center; /* 縦方向の中央揃え */
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.file-icon {
    margin-right: 10px;
}

/* --- Writeup Styles --- */
.writeup-content {
    padding: 40px;
    max-width: 800px; /* 横幅を広げすぎないのが読みやすさのコツ */
    margin: 0 auto;
    line-height: 1.8; /* 行間を広くして読みやすく */
    color: #333;
}

.writeup-content h1 { font-size: 32px; border-bottom: 3px solid #000080; padding-bottom: 10px; }
.writeup-content h2 { font-size: 24px; margin-top: 30px; border-left: 5px solid #000080; padding-left: 15px; }

.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 16px;
}

.writeup-image {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 50px;
    margin: 20px 0;
}

.viewer-window {
    width: 90%;      /* エクスプローラーより少し大きく */
    height: 85vh;
    top: 30px;
    left: 5%;
    z-index: 200;    /* エクスプローラーより前面に出す */
    display: none;
}
