/* === Windows 2003 Full Desktop Experience === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, sans-serif;
  background: #3a6ea5;
  color: #000;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Desktop Container === */
.desktop {
  max-width: none;
  margin: 16px;
  width: auto;
  min-height: calc(100vh - 32px);
  background: #ece9d8;
  border: 2px solid #808080;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

/* === Window content area === */
.window {
  padding: 16px;
  min-height: 400px;
  background: #ece9d8;
}

/* === Status bar === */
.statusbar {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 4px 10px;
  font-size: 13px;
  color: #333;
  overflow: hidden;
  height: 26px;
  line-height: 18px;
}

/* ============================================
   HOMEPAGE — My Computer + Explorer Windows
   ============================================ */

/* My Computer info panel */
.mycomputer-panel {
  background: #ece9d8;
  border: 2px inset #d4d0c8;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.mycomputer-icon {
  font-size: 44px;
  flex-shrink: 0;
  line-height: 1;
}
.mycomputer-info {
  flex: 1;
  min-width: 0;
}
.mycomputer-title {
  font-size: 20px;
  font-weight: bold;
  color: #003497;
}
.mycomputer-desc {
  font-size: 14px;
  color: #444;
  margin-top: 6px;
  line-height: 1.6;
}
.mycomputer-links {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.sys-link {
  font-size: 13px;
  color: #003497;
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid #c0c0c0;
  background: #f0efe8;
}
.sys-link:hover {
  background: #0054e3;
  color: #fff;
}

/* Explorer window */
.explorer-window {
  margin: 0 8px 6px;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #fff;
}
.explorer-titlebar {
  background: linear-gradient(90deg, #0054e3, #3a7be8 80%, #003497);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  padding: 3px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
}
.explorer-btns {
  font-size: 12px;
  font-family: 'Marlett', sans-serif;
  color: #fff;
}
.explorer-toolbar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  font-size: 13px;
}
.tb-btn {
  border: 1px outset #e0e0e0;
  padding: 1px 8px;
  background: #d4d0c8;
  cursor: default;
  font-size: 12px;
}
.tb-sep {
  width: 2px;
  height: 18px;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  margin: 0 4px;
}
.tb-addr {
  font-weight: bold;
  margin-left: 6px;
  font-size: 13px;
}
.tb-url {
  background: #fff;
  border: 1px inset #808080;
  padding: 2px 8px;
  flex: 1;
  font-size: 13px;
  color: #333;
}

/* Explorer body: two-pane */
.explorer-body {
  display: flex;
  min-height: 180px;
}
.explorer-pane {
  width: 160px;
  border-right: 1px solid #c0c0c0;
  background: #fff;
  flex-shrink: 0;
}
.pane-header {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 2px 6px;
  font-weight: bold;
  font-size: 11px;
}
.pane-tree {
  padding: 4px 0;
}
.tree-node {
  padding: 2px 6px;
  font-size: 11px;
  cursor: default;
}
.tree-node:hover { background: #e8e8e8; }
.tree-node.child { padding-left: 24px; }
.tree-node.open { font-weight: bold; }

/* Explorer content: list view */
.explorer-content {
  flex: 1;
  overflow-x: auto;
}
.list-header {
  display: flex;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  font-size: 13px;
  font-weight: bold;
  padding: 3px 8px;
}
.col-name { flex: 1; min-width: 0; }
.col-date { width: 110px; }
.col-section { width: 90px; }
.list-row {
  display: flex;
  padding: 4px 8px;
  font-size: 14px;
  text-decoration: none;
  color: #000;
  border-bottom: 1px solid #e0ddd5;
}
.list-row:hover { background: #e8e8ff; }
.list-row.empty { color: #888; font-style: italic; padding: 14px 10px; }

/* Folder rows & pagination */
.folder-label { cursor: pointer; }
.child-row { padding-left: 28px; }
.child-row:hover { background: #e8e8ff; }
.col-date { display: none; }

.fold-icon {
  display: inline-block;
  width: 16px;
  font-size: 12px;
}

.folder-row {
  display: flex;
  padding: 5px 8px 2px 8px;
  font-size: 14px;
  font-weight: bold;
  color: #003497;
  border-bottom: none;
  background: #f0efe8;
  align-items: center;
}
.pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pg-btn {
  display: inline-block;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 18px;
  font-size: 11px;
  border: 1px solid #c0c0c0;
  background: #fff;
  color: #003497;
  cursor: pointer;
  user-select: none;
}
.pg-btn:hover { background: #e8e8ff; }
.pg-btn:active { border-style: inset; }
.pg-info {
  font-size: 12px;
  font-weight: normal;
  color: #888;
  min-width: 36px;
  text-align: center;
}

/* Tool grid — square badges */
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}
.tool-square {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border: 1px solid #c0c0c0;
  background: #f0efe8;
  text-decoration: none;
  color: #000;
  gap: 6px;
  transition: background 0.15s;
}
.tool-square:hover {
  background: #e8e8ff;
  border-color: #0054e3;
}
.tool-square-icon {
  font-size: 28px;
  line-height: 1;
}
.tool-square-name {
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  word-break: break-all;
}


/* Item title + summary */
.item-title { display: block; }
.item-summary {
  display: block;
  font-size: 12px;
  color: #666;
  font-weight: normal;
  margin-top: 2px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 700px;
}

.explorer-status {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 3px 8px;
  font-size: 13px;
  height: 24px;
}

/* ============================================
   HOMEPAGE LAYOUT — Main + Sidebar
   ============================================ */
.home-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.home-main {
  flex: 1;
  min-width: 0;
}
.home-sidebar {
  width: 320px;
  flex-shrink: 0;
}
.sidebar-block {
  margin-top: 0;
}
.sidebar-block + .sidebar-block {
  margin-top: 10px;
}

/* === Games === */
.game-box {
  background: #222;
  border: 2px inset #d4d0c8;
  padding: 8px;
  text-align: center;
}
#tetrisCanvas {
  display: block;
  margin: 0 auto;
  border: 2px solid #444;
  background: #111;
}
.game-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.game-btn {
  border: 1px outset #e0e0e0;
  background: #d4d0c8;
  padding: 2px 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.game-btn:active { border-style: inset; }

/* === Media Section === */
.media-section {
  padding: 6px 8px;
  max-height: none;
  overflow-y: visible;
}
.media-group {
  margin-bottom: 8px;
}
.media-group:last-child { margin-bottom: 0; }
.media-cat {
  font-size: 12px;
  font-weight: bold;
  color: #555;
  border-bottom: 1px solid #e0ddd5;
  padding-bottom: 2px;
  margin-bottom: 4px;
}
.media-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 12px;
  color: #333;
}
.media-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-meta {
  color: #888;
  font-size: 11px;
  flex-shrink: 0;
}
.media-status {
  font-size: 11px;
  width: 16px;
  text-align: center;
}
.media-stars {
  color: #f90;
  font-size: 10px;
  flex-shrink: 0;
}
.status-done { color: #080; }
.status-reading { color: #06c; }
.status-todo { color: #aaa; }

/* ============================================
   CONTENT PAGES — Article / Single / List
   ============================================ */

/* Inner window frame for content pages */
.window-page {
  border: 2px inset #d4d0c8;
  background: #fff;
  padding: 16px;
  margin: 0;
}
.page-titlebar {
  background: linear-gradient(90deg, #0054e3, #003497);
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  padding: 3px 10px;
  margin: -16px -16px 12px -16px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: #888;
  padding: 0 0 12px 0;
}
.breadcrumb a { color: #5285e8; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Article */
.article h1 {
  font-size: 18px;
  color: #000;
  margin-bottom: 6px;
}
.article-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #c0c0c0;
}
.tag-small {
  background: #ece9d8;
  border: 1px solid #c0c0c0;
  padding: 1px 7px;
  font-size: 12px;
}
.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: #000;
}
.article-body p { margin: 14px 0; }
.article-body h2 { font-size: 20px; margin: 24px 0 12px; }
.article-body h3 { font-size: 17px; margin: 20px 0 10px; }
.article-body code {
  background: #ece9d8;
  padding: 2px 6px;
  font-size: 14px;
  border: 1px solid #d4d0c8;
}
.article-body pre {
  background: #ece9d8;
  border: 2px inset #d4d0c8;
  padding: 14px;
  margin: 14px 0;
  overflow-x: auto;
  font-size: 14px;
}
.article-body pre code { background: none; border: none; padding: 0; }
.article-body img { max-width: 100%; border: 2px inset #d4d0c8; }
.article-body blockquote {
  border-left: 4px solid #808080;
  padding: 10px 18px;
  margin: 14px 0;
  background: #f5f3ed;
  color: #444;
}
.article-body ul, .article-body ol { padding-left: 24px; margin: 8px 0; }
.article-body li { margin: 3px 0; }
.article-body table {
  border-collapse: collapse;
  margin: 10px 0;
  width: 100%;
}
.article-body th, .article-body td {
  border: 1px solid #808080;
  padding: 4px 8px;
  font-size: 12px;
}
.article-body th {
  background: #c0c0c0;
  font-weight: bold;
}

/* Article panel (single page) */
.article-panel {
  background: #fff;
  border: 2px inset #d4d0c8;
  padding: 20px;
}
.article-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #c0c0c0;
  margin-bottom: 16px;
}
.article-header h1 {
  font-size: 22px;
  color: #000;
  margin: 0;
}
.article-meta {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

/* === About page === */
.about-section { margin-top: 16px; }
.about-section h2 {
  font-size: 15px;
  color: #000;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #c0c0c0;
}
.about-section p { font-size: 14px; margin: 6px 0; line-height: 1.7; }
.award-list { list-style: none; padding: 0; }
.award-list li { padding: 4px 0; font-size: 14px; }
.award-year {
  display: inline-block;
  width: 70px;
  font-family: 'Consolas', monospace;
  color: #888;
  font-size: 13px;
}

/* ============================================
   MOBILE RESPONSIVE — 屏幕宽度 ≤ 768px
   ============================================ */
@media (max-width: 768px) {
  /* 桌面容器边距缩小 */
  .desktop {
    margin: 4px;
    min-height: calc(100vh - 8px);
  }
  .window {
    padding: 8px;
    min-height: auto;
  }

  /* 首页：两栏改单栏 */
  .home-layout {
    flex-direction: column;
  }
  .home-sidebar {
    width: 100%;
  }

  /* My Computer 面板：flex 改纵向 */
  .mycomputer-panel {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .mycomputer-links {
    justify-content: center;
  }
  .mycomputer-icon {
    font-size: 36px;
  }
  .mycomputer-title {
    font-size: 17px;
  }

  /* 文章 */
  .article-panel {
    padding: 12px;
  }
  .article-header h1 {
    font-size: 18px;
  }
  .article-body {
    font-size: 15px;
  }
  .article-body h2 { font-size: 17px; }
  .article-body h3 { font-size: 15px; }
  .article-body pre {
    font-size: 13px;
    padding: 10px;
    margin: 10px -4px;
    border-width: 1px;
  }
  .article-body code {
    font-size: 13px;
    word-break: break-all;
  }
  .article-body table {
    display: block;
    overflow-x: auto;
  }

  /* 列表项 */
  .item-summary {
    white-space: normal;
    max-width: 100%;
  }
  .child-row {
    padding-left: 16px;
  }
  .breadcrumb {
    font-size: 12px;
  }

  /* 侧边栏游戏 */
  .game-box {
    padding: 4px;
  }
  #tetrisCanvas {
    width: 160px;
    height: 240px;
  }

  /* 奖品列表 */
  .award-year {
    width: 55px;
    font-size: 12px;
  }

  /* 分页按钮缩小 */
  .pg-btn {
    width: 18px;
    height: 18px;
    line-height: 16px;
    font-size: 10px;
  }
}

/* 小屏手机 ≤ 480px 进一步调整 */
@media (max-width: 480px) {
  .mycomputer-title {
    font-size: 15px;
  }
  .article-body {
    font-size: 14px;
    line-height: 1.7;
  }
  .article-header h1 {
    font-size: 16px;
  }
  .explorer-window {
    margin: 0 2px 4px;
  }
  .list-row {
    padding: 3px 6px;
    font-size: 13px;
  }
  .article-body pre {
    font-size: 12px;
    padding: 8px;
  }
}
