
/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f3f0;
  color: #3a3a3a;
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== Layout ===== */
.layout {
  display: flex;
  width: 90%;
  margin: 0 auto;
  min-height: calc(100vh - 110px);
}

/* ===== Header ===== */
.header {
  background: #fff;
  border-bottom: 1px solid #e8e4df;
  padding: 18px 32px 14px;
}
.header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2a2a2a;
}
.header p {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #fafaf8;
  border-right: 1px solid #e8e4df;
  overflow-y: auto;
  max-height: calc(100vh - 70px);
  position: sticky;
  top: 0;
}
.sidebar-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 14px 6px 12px;
}
.sidebar-search {
  padding: 8px 12px 12px;
}
.sidebar-search input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid #ddd8d0;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
  background: #fff;
  color: #3a3a3a;
}
.sidebar-search input::placeholder { color: #bbb; }
.sidebar-search input:focus { border-color: #aaa; }

/* 树状导航 */
.nav-tree { padding: 0 0 16px; }
.tree-item {
  display: flex;
  align-items: center;
  padding: 6px 12px 6px 12px;
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-item:hover { background: rgba(0,0,0,0.04); }
.tree-item.active {
  background: rgba(100,100,200,0.08);
  color: #333;
  font-weight: 600;
}
.tree-icon { margin-right: 7px; flex-shrink: 0; }
.tree-count {
  font-size: 0.72rem;
  color: #bbb;
  margin-left: auto;
  padding-left: 8px;
  flex-shrink: 0;
}

/* ===== Main ===== */
.main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 32px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.stats { font-size: 0.82rem; color: #999; }
.stats strong { color: #555; }
.search-box {
  padding: 6px 12px;
  border: 1px solid #ddd8d0;
  border-radius: 6px;
  font-size: 0.84rem;
  width: 200px;
  outline: none;
  background: #fff;
}
.search-box:focus { border-color: #aaa; }

/* 文件分区标题 */
.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  padding-bottom: 2px;
  border-bottom: 2px solid #d6d0c8;
}
.section-title:first-child { margin-top: 0; }

/* 文件分区 */
.file-section { margin-bottom: 24px; }

/* 门户子文件夹卡片（继承 .file-card 样式，虚线边框区分） */
.portal-card {
  border-style: dashed;
}

/* 搜索无结果 */
.search-empty {
  text-align: center;
  padding: 48px;
  color: #aaa;
  font-size: 0.92rem;
}

/* 文件列表：手机单列，电脑三栏 */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (min-width: 769px) {
  .file-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}
.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 8px;
  text-decoration: none;
  color: #3a3a3a;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.file-card:hover {
  border-color: #ccc4bc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.file-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 0.87rem;
  font-weight: 500;
  color: #2a2a2a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  font-size: 0.73rem;
  color: #aaa;
  margin-top: 1px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.76rem;
  color: #ccc;
  border-top: 1px solid #e8e4df;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .layout { width: 100%; }
  .header { padding: 14px 16px 10px; }
  .header h1 { font-size: 1.1rem; }
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-height: none;
    position: static;
    border-right: none;
    border-bottom: 1px solid #e8e4df;
    padding: 8px 0;
  }
  .main { padding: 16px; }
  .search-box { width: 100%; }
  .toolbar { flex-direction: column; align-items: flex-start; }
}
