/* ============================================================
   styles.css (static site)
   - Professional finance/tech feel
   - Maintainable design tokens
   - No dependencies
   ============================================================ */

/* ----------------------------
   1) Design tokens (Dark default)
   ---------------------------- */
:root{
  --bg:#0b0f17;
  --panel:#101726;
  --text:#e8eefc;
  --muted:#a9b4d0;
  --border:rgba(255,255,255,.10);
  --shadow:rgba(0,0,0,.28);
  --accent:#4aa3ff;
  --accent2:#33d6c5;
  --radius:16px;
  --container:1100px;
  --focus:2px solid rgba(74,163,255,.9);
}

/* Light theme overrides */
:root[data-theme="light"]{
  --bg:#f6f8fc;
  --panel:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --border:rgba(2,6,23,.12);
  --shadow:rgba(2,6,23,.08);
  --accent:#0b72ff;
  --accent2:#0aa06e;
}

/* ----------------------------
   2) Base styles
   ---------------------------- */
*{box-sizing:border-box;}
html,body{height:100%;}

body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  line-height:1.55;
  background:var(--bg);
  color:var(--text);
}

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

.container{width:min(100% - 32px, var(--container));margin:0 auto;}

.skip-link{
  position:absolute;
  top:-40px;
  left:16px;
  background:var(--panel);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
}
.skip-link:focus{top:16px;outline:var(--focus);}

/* ----------------------------
   3) Header
   ---------------------------- */
.site-header{
  padding:36px 0 18px;
  border-bottom:1px solid var(--border);
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(74,163,255,.16), transparent 55%),
    radial-gradient(900px 500px at 80% 0%, rgba(51,214,197,.12), transparent 60%);
}

.header-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:18px;
  align-items:start;
}

.kicker{
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:.78rem;
  color:var(--muted);
}

.title{
  margin:6px 0;
  font-size:clamp(1.6rem,2.2vw,2.2rem);
  line-height:1.2;
}

.subtitle{
  margin:0 0 14px;
  color:var(--muted);
  max-width:65ch;
}

.badges{display:flex;flex-wrap:wrap;gap:8px;}
.badge{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.04);
  box-shadow:0 6px 18px var(--shadow);
}

/* ----------------------------
   4) Cards & components
   ---------------------------- */
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:0 10px 28px var(--shadow);
  padding:16px;
}

.card-title{font-weight:800;margin-bottom:10px;}

.kv{display:grid;gap:10px;margin:0;}
.kv>div{display:grid;grid-template-columns:120px 1fr;gap:10px;}
dt{color:var(--muted);}
dd{margin:0;}

.notice{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(74,163,255,.30);
  background:rgba(74,163,255,.08);
}
.notice.subtle{
  border:1px solid rgba(51,214,197,.25);
  background:rgba(51,214,197,.07);
}

.muted{color:var(--muted);}
.mt{margin-top:14px;}

/* Buttons */
.header-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(74,163,255,.18), rgba(74,163,255,.06));
  color:var(--text);
  font-weight:700;
}
.btn:hover{filter:brightness(1.04);text-decoration:none;}
.btn:focus{outline:var(--focus);outline-offset:2px;}
.btn-secondary{
  background:rgba(255,255,255,.06);
  font-weight:650;
}

/* ----------------------------
   5) Tabs
   ---------------------------- */
.tabs{margin-top:18px;}

.tablist{
  display:flex;
  flex-wrap: nowrap;      /* 不换行：永远一行 */
  gap: 6px;               /* 更紧凑 */
  overflow-x: auto;       /* 如果屏幕小就横向滚动 */
  -webkit-overflow-scrolling: touch;
  padding:10px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:rgba(255,255,255,.03);
  box-shadow:0 10px 22px var(--shadow);

  /* sticky tabs for “product-level” feel */
  position:sticky;
  top:10px;
  z-index:20;
  backdrop-filter: blur(8px);
}

.tab{
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}

/* Tabs更紧凑，避免两行 */
.tab{
  padding: 8px 10px;   /* 比之前小一点 */
  border-radius: 999px; /* 胶囊式更像产品 */
  white-space: nowrap;  /* Tab文字不换行 */
  flex: 0 0 auto;       /* 保持大小不被压扁 */
}

/* 横向滚动条更“隐形”（可选） */
.tablist::-webkit-scrollbar{ height: 8px; }
.tablist::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
:root[data-theme="light"] .tablist::-webkit-scrollbar-thumb{
  background: rgba(2,6,23,.12);
}

.tab[aria-selected="true"]{
  background:linear-gradient(180deg, rgba(51,214,197,.16), rgba(51,214,197,.06));
  border-color:rgba(51,214,197,.32);
}
.tab:focus{outline:var(--focus);outline-offset:2px;}

.panel{margin-top:14px;}
.hidden{display:none;}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

/* Chips for grading summary */
.chip-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.chip{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:rgba(255,255,255,.03);
}
.chip-k{color:var(--muted);font-size:.92rem;}
.chip-v{font-weight:800;margin-top:2px;}

/* Table */
.table-wrap{
  overflow:auto;
  border-radius:14px;
  border:1px solid var(--border);
}
table{
  width:100%;
  border-collapse:collapse;
  background:rgba(255,255,255,.02);
}
th,td{
  padding:12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}
th{
  text-align:left;
  color:var(--muted);
  font-weight:800;
  background:rgba(255,255,255,.04);
}

/* Schedule table tweaks */
.schedule-table td ul{margin:0;padding-left:18px;}
.schedule-table td li{margin:6px 0;}
.schedule-table td.note{color:var(--muted);font-weight:650;}

/* Resources cards */
.resource-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
}
.resource-card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  background:rgba(255,255,255,.03);
  box-shadow:0 10px 26px var(--shadow);
}
.resource-title{font-weight:900;margin-bottom:8px;}
.resource-list{
  margin:0;
  padding-left:18px;
  color:var(--muted);
}
.resource-list li{margin:8px 0;}

/* Footer */
.site-footer{
  margin:26px 0 40px;
  padding-top:16px;
  border-top:1px solid var(--border);
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* Responsive */
@media (max-width: 900px){
  .header-grid{grid-template-columns:1fr;}
  .grid2{grid-template-columns:1fr;}
  .resource-grid{grid-template-columns:1fr;}
  .chip-grid{grid-template-columns:1fr;}
  .kv>div{grid-template-columns:110px 1fr;}
}

/* Schedule row highlights */
.row-midterm td{
  background: rgba(74,163,255,.10);
}
.row-nolec td{
  background: rgba(51,214,197,.08);
}

/* UEC Pathway steps (clean, professional) */
.steps{
  margin: 12px 0 0;
  padding-left: 18px;
}
.step{
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  box-shadow: 0 10px 22px var(--shadow);
}
.step-title{
  font-weight: 900;
}
.step-desc{
  color: var(--muted);
  margin-top: 4px;
}

/* Quick Info key badges (Time/Location) */
.key-badges{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 12px;
}

.badge-strong{
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(74,163,255,.18), rgba(74,163,255,.06));
  border-color: rgba(74,163,255,.28);
}

.badge-label{
  color: var(--muted);
  font-weight: 800;
}

/* ============================================================
   Theme toggle (Slow_exit-style)
   - very subtle circle
   - no heavy background / no shadow
   - slightly visible on hover/focus
   ============================================================ */
.theme-toggle{
  width: 38px;
  height: 38px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;                 /* 关键：默认透明 */
  border: 1px solid rgba(255,255,255,.14); /* 细圆圈 */
  color: rgba(232,238,252,.85);            /* icon 稍微收敛 */

  cursor: pointer;
  box-shadow: none;                        /* 关键：去掉阴影 */
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

/* light theme下圆圈颜色也更克制 */
:root[data-theme="light"] .theme-toggle{
  border-color: rgba(2,6,23,.14);
  color: rgba(15,23,42,.75);
}

.theme-toggle:hover{
  background: rgba(255,255,255,.05);       /* hover 才出现一点点底色 */
  border-color: rgba(255,255,255,.22);
}

:root[data-theme="light"] .theme-toggle:hover{
  background: rgba(2,6,23,.04);
  border-color: rgba(2,6,23,.22);
}

.theme-toggle:active{
  transform: translateY(1px);
}

.theme-toggle:focus{
  outline: var(--focus);
  outline-offset: 2px;
}

/* icon size inside the circle */
.theme-toggle .icon{
  width: 16px;
  height: 16px;
  display: inline-flex;
}
.theme-toggle .icon svg{
  width: 16px;
  height: 16px;
  display: block;
}

/* ---- FORCE theme toggle into bottom-right of Quick Info card ---- */
.card.header-card{
  position: relative !important;
}

.card.header-card .theme-toggle{
  position: absolute !important;
  right: 16px !important;
  bottom: 16px !important;
  margin: 0 !important;
  z-index: 5 !important;
}
