/* ═══════════ 秋意主题变量 ═══════════ */
:root {
  --primary: #c4501f;          /* 枫叶红 */
  --primary-hover: #a03d15;
  --primary-light: #fdf0e6;    /* 淡枫色 */
  --accent: #d97706;           /* 琥珀橙 */
  --accent-light: #fef4e0;
  --brown: #78350f;            /* 深棕 */
  --brown-light: #b45309;
  --text: #3d2817;             /* 深棕黑文字 */
  --text-secondary: #78614a;   /* 次要文字 */
  --text-tertiary: #a89078;    /* 弱文字 */
  --bg: #fdf8f0;               /* 米黄背景 */
  --bg-warm: #f9eedb;          /* 暖米黄 */
  --card-bg: #fffdf9;          /* 米白卡片 */
  --border: #ecdfcc;           /* 暖边框 */
  --border-hover: #e0c9a8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(120,53,15,0.06);
  --shadow-md: 0 4px 16px rgba(120,53,15,0.08);
  --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(217,119,6,0.04) 0%, transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(196,80,31,0.03) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(120,53,15,0.025) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

/* ═══════════ 秋叶飘落背景 ═══════════ */
.leaves-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.leaf {
  position: absolute;
  top: -40px;
  font-size: 20px;
  opacity: 0.4;
  animation: leafFall linear infinite;
  user-select: none;
}
@keyframes leafFall {
  0% {
    transform: translateY(-40px) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.5; }
  90% { opacity: 0.4; }
  100% {
    transform: translateY(100vh) rotate(360deg) translateX(60px);
    opacity: 0;
  }
}

/* ═══════════ 顶部工具栏 ═══════════ */
.top-bar {
  position: relative;
  z-index: 10;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-left a, .top-right a { margin-right: 16px; color: var(--text-secondary); }
.top-right a { margin: 0 0 0 16px; }
.top-right { display: flex; align-items: center; gap: 6px; }
#clockDisplay { color: var(--text-tertiary); font-size: 12px; }

/* ═══════════ 头部 ═══════════ */
.site-header {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, #fffdf9 0%, #fdf6e9 100%);
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.logo-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.logo-leaf {
  font-size: 34px;
  filter: drop-shadow(0 2px 4px rgba(196,80,31,0.25));
}
.logo-text {
  font-size: 30px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(196,80,31,0.1);
}
.logo-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  margin-top: 6px;
  padding-left: 44px;
}

.search-area { flex: 1; min-width: 0; }
.search-box {
  display: flex;
  max-width: 640px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}
.search-box:focus-within {
  box-shadow: 0 0 0 4px rgba(196,80,31,0.12);
}
.search-box input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  background: transparent;
}
.search-box button {
  padding: 0 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
  transition: filter 0.2s;
}
.search-box button:hover { filter: brightness(1.08); }

.hot-words {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.hw-label { color: var(--accent); font-weight: 600; }
.hot-words a { color: var(--text-secondary); }
.hot-words a:hover { color: var(--primary); }

/* ═══════════ 分类导航栏 ═══════════ */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,253,249,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 12px rgba(120,53,15,0.04);
}
.cat-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
}
.cat-nav-item {
  padding: 12px 22px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}
.cat-nav-item:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.cat-nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}
.cat-nav-item.active::before {
  content: "🍁";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
}

/* ═══════════ 主内容 ═══════════ */
.main-content {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

/* ═══════════ 工具区块 ═══════════ */
.tool-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s;
}
.tool-section:hover {
  box-shadow: var(--shadow-md);
}
.tool-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.tool-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brown);
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.tool-section-title .ts-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 6px;
}
.tool-section-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* 工具网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px 4px;
}

/* 工具项 */
.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}
.tool-item:hover {
  background: var(--primary-light);
}
.tool-item:hover .tool-name { color: var(--primary); }

.tool-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 17px;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  transition: transform 0.2s;
  box-shadow: 0 2px 6px rgba(120,53,15,0.1);
}
.tool-item:hover .tool-icon {
  transform: translateY(-2px) scale(1.06);
}
.tool-name {
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color 0.18s;
}

/* ═══════════ 图标颜色主题（秋色系） ═══════════ */
.ti-blue    { background: linear-gradient(135deg, #4a7fb5, #2c5f8f); }
.ti-purple  { background: linear-gradient(135deg, #9b6db8, #7a4a95); }
.ti-red     { background: linear-gradient(135deg, #dc5a3d, #b8391c); }
.ti-orange  { background: linear-gradient(135deg, #e89038, #c46b1a); }
.ti-green   { background: linear-gradient(135deg, #7ba050, #56802e); }
.ti-teal    { background: linear-gradient(135deg, #4a9b8e, #2d7267); }
.ti-pink    { background: linear-gradient(135deg, #d97891, #b34e68); }
.ti-indigo  { background: linear-gradient(135deg, #6b7cb8, #4a5b95); }
.ti-cyan    { background: linear-gradient(135deg, #4fa3c0, #2c7e9b); }
.ti-amber   { background: linear-gradient(135deg, #e5a934, #c4831a); }
.ti-rose    { background: linear-gradient(135deg, #d95c69, #b23a48); }
.ti-violet  { background: linear-gradient(135deg, #8a6ac4, #6745a3); }
.ti-emerald { background: linear-gradient(135deg, #5b9f6a, #387a46); }
.ti-sky     { background: linear-gradient(135deg, #6ba3cf, #4280ad); }
.ti-slate   { background: linear-gradient(135deg, #7c7067, #5c4f45); }

/* ═══════════ 底部全站链接地图 ═══════════ */
.link-map-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.lm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 18px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lm-leaf { font-size: 16px; }
.link-map-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 32px;
}
.lm-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.lm-group-title::before {
  content: "▪";
  color: var(--accent);
  font-size: 14px;
}
.lm-group-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lm-group-list a {
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-block;
  padding-left: 0;
}
.lm-group-list a:hover {
  color: var(--primary);
  padding-left: 4px;
}

/* ═══════════ 页脚 ═══════════ */
.site-footer {
  position: relative;
  z-index: 5;
  background: linear-gradient(180deg, #fdf6e9 0%, #f5e8d3 100%);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.footer-links { margin-bottom: 10px; }
.footer-links a { color: var(--text-secondary); margin: 0 8px; }
.footer-links a:hover { color: var(--primary); }

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 900px) {
  .header-inner { flex-direction: column; gap: 16px; align-items: stretch; }
  .logo-area { align-items: center; }
  .logo-sub { padding-left: 0; }
  .search-box { max-width: none; }
  .link-map-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
@media (max-width: 600px) {
  .main-content { padding: 0 12px; }
  .tool-section { padding: 16px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px 2px; }
  .tool-icon { width: 30px; height: 30px; font-size: 15px; border-radius: 7px; }
  .tool-name { font-size: 11px; }
  .cat-nav-item { padding: 10px 14px; font-size: 13px; }
  .cat-nav-item.active::before { display: none; }
  .link-map-grid { grid-template-columns: 1fr; gap: 14px; }
  .logo-text { font-size: 24px; }
  .logo-leaf { font-size: 28px; }
}