/* ============================================================
   GRWeb · 个人工作与学习记录站
   设计系统：绿色主色 / 圆角 / 柔和阴影 / 浅色为主
   ============================================================ */

:root {
  /* 主色（绿） */
  --c-primary: #10b981;
  --c-primary-dark: #059669;
  --c-primary-light: #d1fae5;
  --c-primary-soft: #ecfdf5;

  /* 辅助色 */
  --c-cyan: #06b6d4;
  --c-amber: #f59e0b;
  --c-rose: #f43f5e;
  --c-violet: #8b5cf6;
  --c-blue: #3b82f6;

  /* 中性 */
  --bg: #f6f8f7;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f3;
  --border: #e5ebe8;
  --border-strong: #d3dedb;

  --text: #16241f;
  --text-2: #4a5c56;
  --text-3: #85968f;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(16, 36, 31, .05);
  --shadow: 0 4px 16px rgba(16, 36, 31, .07);
  --shadow-lg: 0 12px 40px rgba(16, 36, 31, .11);

  --grad-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-hero: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 45%, #ecfeff 100%);

  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 深色模式 */
[data-theme="dark"] {
  --bg: #0e1614;
  --bg-card: #16211e;
  --bg-subtle: #1b2724;
  --border: #26332f;
  --border-strong: #35443f;

  --text: #e8f0ed;
  --text-2: #a8bcb5;
  --text-3: #6f837c;

  --c-primary-light: #10453a;
  --c-primary-soft: #12241f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  --grad-hero: linear-gradient(135deg, #10241f 0%, #0f2429 50%, #102028 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }

/* ============ 布局 ============ */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ============ 顶部导航 ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .nav { background: rgba(14, 22, 20, .85); }

.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .32);
}

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; font-size: 14px;
  color: var(--text-2); font-weight: 500;
  transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--bg-subtle); color: var(--text); }
.nav-links a.active { background: var(--c-primary-soft); color: var(--c-primary-dark); font-weight: 600; }
[data-theme="dark"] .nav-links a.active { color: var(--c-primary); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-2); transition: background .18s, color .18s;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 11px;
  font-size: 14px; font-weight: 600;
  transition: transform .15s, box-shadow .2s, background .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, .3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(16, 185, 129, .42); }
.btn-ghost { background: var(--bg-subtle); color: var(--text-2); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-outline {
  background: var(--bg-card); color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary-dark); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-danger { color: var(--c-rose); }
.btn-danger:hover { background: #fff1f3; }
[data-theme="dark"] .btn-danger:hover { background: #2a1618; }

/* ============ 卡片 ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-title {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.card-title .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-primary);
}
.card-title .more {
  margin-left: auto; font-size: 13px; font-weight: 500; color: var(--text-3);
}
.card-title .more:hover { color: var(--c-primary-dark); }

/* ============ 首页 Hero ============ */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero);
  border-bottom: 1px solid var(--border);
  padding: 60px 0 68px;
}
.hero::after {
  content: ""; position: absolute; right: -140px; top: -120px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .16), transparent 68%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(16, 185, 129, .28);
  font-size: 13px; color: var(--c-primary-dark); font-weight: 600;
  margin-bottom: 20px;
}
[data-theme="dark"] .hero-eyebrow { background: rgba(16, 185, 129, .1); }
.hero-eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.hero h1 {
  font-size: 42px; line-height: 1.2; font-weight: 800;
  letter-spacing: -1px; margin-bottom: 14px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #059669, #06b6d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 16px; color: var(--text-2); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ============ 统计卡片 ============ */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-top: -38px; position: relative; z-index: 2;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-label {
  font-size: 13px; color: var(--text-3); font-weight: 500;
  display: flex; align-items: center; gap: 7px;
}
.stat-label .ic {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-size: 13px;
}
.stat-value {
  font-size: 32px; font-weight: 800; letter-spacing: -1px;
  margin-top: 8px; line-height: 1;
}
.stat-value small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ============ 首页主体网格 ============ */
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin-top: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.section { padding: 8px 0 64px; }

/* ============ 时间线 ============ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-card); border: 3px solid var(--c-primary);
}
.tl-item.learn::before { border-color: var(--c-cyan); }
.tl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-title { font-weight: 650; font-size: 15px; }
.tl-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; }
.tl-body {
  font-size: 13.5px; color: var(--text-2); margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ 标签 ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 7px;
  font-size: 12px; font-weight: 600;
  background: var(--bg-subtle); color: var(--text-2);
}
.tag-green { background: var(--c-primary-soft); color: var(--c-primary-dark); }
[data-theme="dark"] .tag-green { color: var(--c-primary); }
.tag-cyan { background: #ecfeff; color: #0e7490; }
[data-theme="dark"] .tag-cyan { background: #0c2a30; color: #67e8f9; }
.tag-amber { background: #fffbeb; color: #b45309; }
[data-theme="dark"] .tag-amber { background: #2c2210; color: #fcd34d; }
.tag-rose { background: #fff1f2; color: #be123c; }
[data-theme="dark"] .tag-rose { background: #2d1418; color: #fda4af; }
.tag-violet { background: #f5f3ff; color: #6d28d9; }
[data-theme="dark"] .tag-violet { background: #221a3d; color: #c4b5fd; }
.tag-blue { background: #eff6ff; color: #1d4ed8; }
[data-theme="dark"] .tag-blue { background: #14243d; color: #93c5fd; }

/* ============ 条形分布 ============ */
.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px;
}
.bar-head .v { color: var(--text-3); font-variant-numeric: tabular-nums; }
.bar-track {
  height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 999px;
  background: var(--grad-primary);
  transition: width .8s cubic-bezier(.22, 1, .36, 1);
}

/* ============ 打卡热力图 ============ */
.heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 5px; }
.heat-cell {
  aspect-ratio: 1; border-radius: 5px;
  background: var(--bg-subtle);
  transition: transform .15s;
}
.heat-cell:hover { transform: scale(1.18); }
.heat-cell.l1 { background: #a7f3d0; }
.heat-cell.l2 { background: #6ee7b7; }
.heat-cell.l3 { background: #34d399; }
.heat-cell.l4 { background: #059669; }
[data-theme="dark"] .heat-cell.l1 { background: #10453a; }
[data-theme="dark"] .heat-cell.l2 { background: #0d6b52; }
[data-theme="dark"] .heat-cell.l3 { background: #0f9b73; }
[data-theme="dark"] .heat-cell.l4 { background: #10b981; }
.heat-legend {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3); margin-top: 12px;
  justify-content: flex-end;
}

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--bg-subtle); }
tbody tr:last-child td { border-bottom: none; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin-bottom: 18px;
}
.field {
  padding: 9px 13px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.field:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(16, 185, 129, .13); }
select.field { cursor: pointer; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box .field { width: 100%; padding-left: 36px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 25, 20, .45);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask.show { display: flex; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: pop .25s cubic-bezier(.22, 1, .36, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head {
  padding: 22px 24px 0; display: flex; align-items: center;
}
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 20px 24px; }
.modal-foot {
  padding: 0 24px 24px; display: flex; gap: 10px; justify-content: flex-end;
}

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 7px; color: var(--text-2);
}
.form-row .field, .form-row textarea.field { width: 100%; }
textarea.field { resize: vertical; min-height: 88px; line-height: 1.6; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 52px 20px; color: var(--text-3); }
.empty .ic { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty p { font-size: 14px; }

/* ============ 图表（纯 CSS/SVG） ============ */
.chart-bars {
  display: flex; align-items: flex-end; gap: 6px;
  height: 180px; padding-top: 10px;
}
.chart-bars .cb {
  flex: 1; border-radius: 6px 6px 2px 2px;
  background: var(--grad-primary);
  min-height: 3px; position: relative;
  transition: height .7s cubic-bezier(.22, 1, .36, 1);
}
.chart-bars .cb:hover::after {
  content: attr(data-v);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg-card);
  padding: 3px 8px; border-radius: 6px; font-size: 11px;
  white-space: nowrap; margin-bottom: 5px;
}
.chart-axis {
  display: flex; gap: 6px; margin-top: 8px;
  font-size: 11px; color: var(--text-3);
}
.chart-axis span { flex: 1; text-align: center; }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0; text-align: center;
  font-size: 13px; color: var(--text-3);
}

/* ============ 页面标题区 ============ */
.page-head { padding: 40px 0 22px; }
.page-head h2 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text); color: var(--bg-card);
  padding: 11px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .3s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .form-2 { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 52px; }
}
