/* ============================================================
   个人学习站 · 深色科技风主题
   ============================================================ */
:root {
  --bg-0: #060910;
  --bg-1: #0b111c;
  --bg-2: #101827;
  --panel: rgba(19, 27, 43, 0.72);
  --panel-solid: #131b2b;
  --line: rgba(120, 160, 220, 0.16);
  --line-strong: rgba(120, 160, 220, 0.32);
  --text-0: #eaf2ff;
  --text-1: #a9bad6;
  --text-2: #6d7f9c;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --glow-cyan: 0 0 22px rgba(34, 211, 238, 0.35);
  --glow-violet: 0 0 22px rgba(167, 139, 250, 0.35);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text-0);
  background: var(--bg-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 背景：网格 + 光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(90, 130, 200, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 130, 200, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 35%, transparent 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(680px 420px at 12% -8%, rgba(34, 211, 238, 0.16), transparent 70%),
    radial-gradient(620px 480px at 92% 4%, rgba(167, 139, 250, 0.16), transparent 72%),
    radial-gradient(700px 500px at 50% 108%, rgba(52, 211, 153, 0.09), transparent 70%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(8, 12, 20, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .3px; }
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.5; transform:scale(.82);} }
.brand small { color: var(--text-2); font-weight: 400; font-family: var(--mono); font-size: 11px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-1);
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 14.5px;
  transition: .18s;
  border: 1px solid transparent;
}
.nav-links a:hover { color: var(--text-0); background: rgba(120,160,220,.09); text-decoration: none; }
.nav-links a.active {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
}

/* ---------------- 布局 ---------------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 42px 24px 90px; }
.page-head { margin-bottom: 30px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 9px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--cyan); opacity: .7; }
h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: -.5px; }
h2 { font-size: 21px; margin: 0 0 4px; }
h3 { font-size: 16.5px; margin: 0; }
.lead { color: var(--text-1); font-size: 15.5px; max-width: 720px; margin: 0; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-strong); }
.section { margin-top: 40px; }
.section-title {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px;
}
.section-title .idx { font-family: var(--mono); color: var(--text-2); font-size: 13px; }
.section-title h2 { font-size: 19px; }

/* ---------------- 统计条 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.stat {
  background: linear-gradient(150deg, rgba(34,211,238,.09), rgba(167,139,250,.05));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat .num { font-family: var(--mono); font-size: 27px; font-weight: 700; color: var(--text-0); }
.stat .num.c { color: var(--cyan); } .stat .num.v { color: var(--violet); }
.stat .num.g { color: var(--green); } .stat .num.a { color: var(--amber); }
.stat .lbl { font-size: 12.5px; color: var(--text-2); letter-spacing: .4px; }

/* ---------------- 学习卡片 ---------------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.learn-card { display: flex; flex-direction: column; gap: 13px; }
.learn-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.learn-card h3 { line-height: 1.4; }
.learn-meta { font-size: 12.5px; color: var(--text-2); font-family: var(--mono); }
.badge {
  font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  font-family: var(--mono); letter-spacing: .4px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge.study { color: var(--cyan); background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.3); }
.badge.project { color: var(--violet); background: rgba(167,139,250,.12); border-color: rgba(167,139,250,.3); }
.badge.course { color: var(--green); background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); }
.badge.done { color: var(--green); background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.32); }
.badge.doing { color: var(--amber); background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
.badge.todo { color: var(--text-2); background: rgba(120,160,220,.1); border-color: var(--line-strong); }

/* 进度条 */
.bar { height: 7px; border-radius: 99px; background: rgba(120,160,220,.14); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.bar.g > i { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .pct { font-family: var(--mono); font-size: 13px; color: var(--text-1); min-width: 42px; text-align: right; }
.note { font-size: 13.5px; color: var(--text-1); margin: 0; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; color: var(--text-1); font-family: var(--mono);
  background: rgba(120,160,220,.09); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 6px;
}
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }

/* ---------------- 按钮 ---------------- */
.btn {
  font-family: inherit; font-size: 13.5px; cursor: pointer;
  padding: 9px 16px; border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(120,160,220,.08);
  color: var(--text-0);
  transition: .16s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { background: rgba(120,160,220,.16); border-color: rgba(120,160,220,.5); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, rgba(34,211,238,.22), rgba(167,139,250,.22));
  border-color: rgba(34,211,238,.5);
  color: #fff;
  box-shadow: 0 6px 20px rgba(34,211,238,.16);
}
.btn.primary:hover { box-shadow: var(--glow-cyan); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--rose); border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }
.btn.danger:hover { background: rgba(251,113,133,.16); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--text-1); }
.input, .textarea, .select {
  font-family: inherit; font-size: 14px;
  background: rgba(6, 10, 18, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text-0);
  padding: 10px 13px;
  width: 100%;
  transition: .16s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34,211,238,.14);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select option { background: var(--panel-solid); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 130px; }

/* ---------------- 互助页 ---------------- */
.post {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, rgba(34,211,238,.25), rgba(167,139,250,.25));
  border: 1px solid var(--line-strong); color: var(--text-0);
}
.post-head .who { font-size: 14px; font-weight: 600; }
.post-head .when { font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.post-body { color: var(--text-1); font-size: 14.5px; white-space: pre-wrap; margin: 4px 0 0; }
.replies {
  margin: 16px 0 0 0; padding-left: 18px;
  border-left: 2px solid var(--line-strong);
  display: flex; flex-direction: column; gap: 12px;
}
.reply { font-size: 14px; }
.reply .who { color: var(--cyan); font-weight: 600; font-size: 13.5px; }
.reply .when { color: var(--text-2); font-size: 11.5px; font-family: var(--mono); margin-left: 8px; }
.reply p { margin: 3px 0 0; color: var(--text-1); white-space: pre-wrap; }
.reply-form { display: flex; gap: 10px; margin-top: 14px; }
.reply-form .input { flex: 1; }
.empty {
  text-align: center; color: var(--text-2); padding: 46px 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  font-size: 14px;
}

/* ---------------- 行事历 ---------------- */
.lock-screen {
  max-width: 400px; margin: 60px auto; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 40px 32px; backdrop-filter: blur(12px);
}
.lock-icon { font-size: 44px; margin-bottom: 14px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-1); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.study { background: var(--cyan); } .swatch.life { background: var(--violet); }
.swatch.task { background: var(--amber); } .swatch.other { background: var(--rose); }

.event-list { display: flex; flex-direction: column; gap: 11px; }
.event {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); padding: 13px 16px;
  border-left-width: 4px;
  transition: .18s;
}
.event:hover { border-color: var(--line-strong); }
.event.study { border-left-color: var(--cyan); }
.event.life { border-left-color: var(--violet); }
.event.task { border-left-color: var(--amber); }
.event.other { border-left-color: var(--rose); }
.event.done { opacity: .5; }
.event.done .ev-title { text-decoration: line-through; }
.check {
  width: 22px; height: 22px; border-radius: 7px; flex: none; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: transparent;
  display: grid; place-items: center; color: transparent; font-size: 13px;
  transition: .16s;
}
.check:hover { border-color: var(--cyan); }
.event.done .check { background: var(--green); border-color: var(--green); color: #04120c; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { font-size: 14.5px; font-weight: 600; }
.ev-sub { font-size: 12.5px; color: var(--text-2); font-family: var(--mono); margin-top: 2px; }
.ev-time {
  font-family: var(--mono); font-size: 13px; color: var(--text-1);
  background: rgba(120,160,220,.1); padding: 4px 10px; border-radius: 7px; white-space: nowrap;
}
.ev-bell { color: var(--amber); font-size: 13px; }

.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(6px);
  display: none; place-items: center; padding: 20px;
}
.modal-mask.show { display: grid; }
.modal {
  width: 100%; max-width: 480px;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  max-height: 90vh; overflow: auto;
}
.modal h3 { margin-bottom: 18px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 提醒 toast */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 250px; max-width: 340px;
  background: var(--panel-solid); border: 1px solid rgba(251,191,36,.45);
  border-left: 4px solid var(--amber); border-radius: 11px;
  padding: 13px 16px; box-shadow: var(--shadow);
  animation: slideIn .3s cubic-bezier(.2,.8,.2,1);
}
.toast .t-title { font-size: 13px; color: var(--amber); font-family: var(--mono); letter-spacing: .5px; }
.toast .t-body { font-size: 14px; margin-top: 3px; }
.toast .t-time { font-size: 12px; color: var(--text-2); font-family: var(--mono); margin-top: 2px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

.footer {
  text-align: center; color: var(--text-2); font-size: 12.5px;
  padding: 30px 20px 44px; font-family: var(--mono);
  border-top: 1px solid var(--line); margin-top: 40px;
}
.hint { font-size: 12.5px; color: var(--text-2); margin-top: 9px; }
.divider { height: 1px; background: var(--line); margin: 34px 0; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  h1 { font-size: 27px; }
  .nav-inner { padding: 12px 16px; gap: 14px; }
  .wrap { padding: 30px 16px 70px; }
  .nav-links a { padding: 7px 11px; font-size: 13.5px; }
}

/* ================= 门户首页 ================= */
.portal { max-width: 1120px; margin: 0 auto; padding: 26px 24px 80px; }
.portal-grid {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px) 1fr;
  gap: 24px 20px;
  align-items: center;
  margin-top: 10px;
}
.portal-mid {
  grid-column: 2; grid-row: 1 / span 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center;
}
.mascot-ring { position: relative; width: 280px; height: 280px; }
.mascot-ring::before {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 1.5px dashed rgba(34, 211, 238, 0.4);
  animation: orbit 26s linear infinite;
}
.mascot-ring::after {
  content: ""; position: absolute; inset: -34px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.18) 0%, rgba(167,139,250,.12) 45%, transparent 72%);
  z-index: -1;
  animation: breathe 4.5s ease-in-out infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100%{opacity:.65; transform:scale(1);} 50%{opacity:1; transform:scale(1.06);} }
.mascot-ring img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-11px);} }
.portal-slogan h1 { font-size: 30px; margin: 0 0 8px; }
.portal-slogan p { color: var(--text-1); margin: 0; font-size: 15px; }
.portal-hello {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 2.6px;
  color: var(--cyan); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 4px;
}
.portal-hello::before, .portal-hello::after { content: ""; width: 24px; height: 1px; background: var(--cyan); opacity: .6; }

.portal-tile {
  display: flex; align-items: center; gap: 15px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
  cursor: pointer; text-decoration: none;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  backdrop-filter: blur(10px);
}
.portal-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 14px 40px rgba(34, 211, 238, 0.13);
  text-decoration: none;
}
.portal-tile .p-icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(140deg, rgba(34,211,238,.16), rgba(167,139,250,.16));
  border: 1px solid var(--line-strong);
}
.portal-tile .p-txt { flex: 1; min-width: 0; }
.portal-tile .p-txt h3 { font-size: 16.5px; }
.portal-tile .p-txt p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }
.portal-tile .p-arrow { color: var(--text-2); font-size: 18px; transition: .2s; }
.portal-tile:hover .p-arrow { color: var(--cyan); transform: translateX(4px); }
.pos-tl { grid-column: 1; grid-row: 1; }
.pos-tr { grid-column: 3; grid-row: 1; }
.pos-bl { grid-column: 1; grid-row: 2; }
.pos-br { grid-column: 3; grid-row: 2; }

@media (max-width: 940px) {
  .portal-grid { grid-template-columns: 1fr; gap: 14px; }
  .portal-mid { grid-column: 1; grid-row: auto; order: -1; }
  .pos-tl, .pos-tr, .pos-bl, .pos-br { grid-column: 1; grid-row: auto; }
  .mascot-ring { width: 220px; height: 220px; }
}

/* ================= 展示位 ================= */
.show-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.show-tile {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); overflow: hidden; display: flex; flex-direction: column;
  transition: .18s; position: relative; text-decoration: none;
}
.show-tile:hover { border-color: rgba(34,211,238,.42); transform: translateY(-3px); text-decoration: none; }
.show-tile img { width: 100%; height: 128px; object-fit: cover; display: block; background: #0a0f1a; }
.show-tile .s-body { padding: 12px 14px; }
.show-tile .s-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.show-tile .s-title .s-kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px; padding: 2px 7px;
  border-radius: 5px; background: rgba(34,211,238,.14); color: var(--cyan); font-weight: 400;
}
.show-tile .s-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.show-tile .s-tools {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: .18s;
}
.show-tile:hover .s-tools { opacity: 1; }
.s-tools .btn { padding: 4px 9px; font-size: 11.5px; backdrop-filter: blur(6px); }
.show-add {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  display: grid; place-items: center; min-height: 176px; color: var(--text-2);
  cursor: pointer; font-size: 13.5px; transition: .18s; background: rgba(120,160,220,.04);
}
.show-add:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(34,211,238,.06); }

/* ================= 成果详情页 ================= */
.crumb { font-size: 13px; color: var(--text-2); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.crumb a { color: var(--text-1); }
.crumb a:hover { color: var(--cyan); }
.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail-head h1 { font-size: 27px; margin: 0; flex: 1; min-width: 220px; }
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet)); opacity: .45; }
.tl-item { position: relative; padding: 0 0 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-1); border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(34,211,238,.5);
}
.tl-item h4 { margin: 0 0 3px; font-size: 15px; }
.tl-item span { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }

