:root{
  --bg1:#eef6ff;
  --bg2:#f7fbff;
  --card:#ffffffcc;
  --stroke:#e6eef8;
  --text:#0f172a;
  --muted:#6b7280;
  --shadow: 0 18px 50px rgba(15, 23, 42, .10);
  --r: 22px;
}

*{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, "PingFang SC","Hiragino Sans GB","Microsoft YaHei", sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,var(--bg1),var(--bg2));
}

.hidden{display:none !important;}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(59,130,246,.18), transparent 60%),
    radial-gradient(900px 500px at 85% 20%, rgba(16,185,129,.16), transparent 55%),
    radial-gradient(900px 500px at 55% 85%, rgba(245,158,11,.12), transparent 60%);
  pointer-events:none;
}

.topbar{
  width:min(1180px, calc(100% - 34px));
  margin:24px auto 14px;
  padding:18px 20px;
  border-radius:28px;
  background:var(--card);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
}

.logo{
  width:44px;
  height:44px;
  border-radius:16px;
  background-image:url("/imgs/logo.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:cover;
  box-shadow:0 10px 24px rgba(0,0,0,0.18);
}

.brand-text .title{font-size:18px;font-weight:800;letter-spacing:.2px;}
.brand-text .subtitle{font-size:12px;color:var(--muted);margin-top:2px;}

.top-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;}
.pill{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:999px;
  background:#fff;
  border:1px solid var(--stroke);
}
.pill-text{font-size:13px;color:#334155;}
.dot{width:10px;height:10px;border-radius:50%;}
.dot-gray{background:#9ca3af;}
.dot-green{background:#10b981;}

.btn{
  border:1px solid var(--stroke);
  background:#fff;
  color:#0f172a;
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn:hover{filter:brightness(.98);}
.btn.primary{
  background:linear-gradient(135deg, rgba(59,130,246,.16), rgba(59,130,246,.06));
  border-color: rgba(59,130,246,.35);
}
.btn.ghost{background:#fff;}

.layout{
  width:min(1180px, calc(100% - 34px));
  margin:0 auto 40px;
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:18px;
}

.sidebar{
  padding:16px;
  border-radius:28px;
  background:var(--card);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow);
}

.nav-item{
  width:100%;
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border-radius:18px;
  border:1px solid transparent;
  background:transparent;
  cursor:pointer;
}
.nav-item:hover{background:rgba(255,255,255,.7);}
.nav-item.active{
  background:linear-gradient(135deg, rgba(59,130,246,.12), rgba(59,130,246,.03));
  border-color: rgba(59,130,246,.25);
  box-shadow: 0 10px 26px rgba(59,130,246,.10);
}
.nav-ico{
  width:34px;height:34px;border-radius:14px;
  display:grid;place-items:center;
  background:#fff;border:1px solid var(--stroke);
  font-weight:900;
}
.nav-text{display:flex;flex-direction:column;align-items:flex-start;gap:2px;flex:1;}
.nav-title{font-weight:900;}
.nav-desc{font-size:12px;color:var(--muted);}
.nav-tag{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:#fff;
  font-size:12px;
  color:#475569;
}

.sidebar-note{
  margin-top:14px;
  padding:12px 12px;
  border-radius:18px;
  border:1px dashed rgba(148,163,184,.55);
  background:rgba(255,255,255,.55);
}
.note-title{font-weight:900;margin-bottom:6px;}
.note-text{font-size:12px;color:var(--muted);line-height:1.6;}

.content{
  padding:16px;
  border-radius:28px;
  background:var(--card);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow);
}

.panel-head{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:14px;margin-bottom:12px;
}
.panel-title{font-size:20px;font-weight:950;}
.panel-sub{font-size:12px;color:var(--muted);margin-top:4px;}
.head-right{display:flex;gap:10px;align-items:center;}

.status-pill{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:999px;
  background:#fff;border:1px solid var(--stroke);
  font-weight:800;font-size:13px;
}
.status-pill.strong-green{border-color: rgba(16,185,129,.35);}
.status-pill.strong-red{border-color: rgba(239,68,68,.25);}

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

.mt14{margin-top:14px;}

.card{
  background:#fff;
  border:1px solid var(--stroke);
  border-radius:24px;
  padding:14px;
  box-shadow: 0 14px 40px rgba(15,23,42,.06);
}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.card-title{font-weight:950;}
.card-meta{font-size:12px;color:var(--muted);}

.class-hero{
  display:flex;align-items:stretch;justify-content:space-between;
  gap:12px;
  padding:12px;
  border-radius:20px;
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(248,250,252,1), rgba(255,255,255,1));
  margin-bottom:10px;
}
.class-hero.strong-green{border-color: rgba(16,185,129,.35);}
.class-hero.strong-red{border-color: rgba(239,68,68,.25);}

.hero-state{font-size:22px;font-weight:950;}
.hero-desc{margin-top:6px;color:#334155;font-size:13px;}
.big-badge{
  min-width:110px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background:#fff;
  padding:10px 12px;
  text-align:center;
}
.big-badge-title{font-size:12px;color:var(--muted);font-weight:800;}
.big-badge-value{margin-top:4px;font-size:18px;font-weight:950;}

.kv{border-top:1px dashed rgba(148,163,184,.45);padding-top:10px;}
.kv-row{display:flex;justify-content:space-between;gap:10px;padding:6px 0;}
.kv-k{color:var(--muted);font-size:12px;font-weight:800;}
.kv-v{font-size:13px;font-weight:800;color:#0f172a;}

.list{display:flex;flex-direction:column;gap:10px;}
.item{
  border:1px solid var(--stroke);
  border-radius:18px;
  padding:12px;
  background:linear-gradient(180deg, rgba(248,250,252,1), rgba(255,255,255,1));
  display:flex;align-items:flex-start;justify-content:space-between;gap:10px;
}
.item-title{font-weight:950;margin-bottom:4px;}
.item-sub{font-size:12px;color:var(--muted);line-height:1.55;}
.item-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.badge{
  padding:7px 10px;border-radius:999px;
  font-size:12px;font-weight:900;
  border:1px solid var(--stroke);
  background:#fff;
}
.badge.good{border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.06);}
.badge.warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.06);}
.badge.gray{color:#475569;background:#fff;}

.small-btn{
  border:1px solid var(--stroke);
  background:#fff;
  border-radius:999px;
  padding:8px 10px;
  font-weight:900;
  cursor:pointer;
}
.small-btn.danger{
  border-color: rgba(239,68,68,.25);
  background: rgba(239,68,68,.06);
}

.empty{
  padding:18px;
  border-radius:18px;
  border:1px dashed rgba(148,163,184,.55);
  background:rgba(255,255,255,.6);
  color:var(--muted);
  font-weight:800;
  text-align:center;
}

.form{padding-top:2px;}
.form-row{margin-bottom:12px;}
label{display:block;font-size:12px;color:#334155;font-weight:900;margin-bottom:8px;}
.input{
  width:100%;
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:12px 12px;
  font-weight:800;
  outline:none;
}
.input:focus{border-color: rgba(59,130,246,.45); box-shadow: 0 0 0 5px rgba(59,130,246,.10);}
.input.small{max-width:220px;}
.row-inline{display:flex;gap:10px;align-items:center;}
.chip{
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:#fff;
  color:#334155;
  font-weight:900;
  font-size:12px;
}
.hr{height:1px;background:rgba(148,163,184,.25);margin:12px 0;}
.form-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.form-hint{font-size:12px;color:var(--muted);font-weight:900;}

.class-wide .box{
  border:1px solid var(--stroke);
  border-radius:18px;
  padding:12px;
  background:#fff;
}
.line{
  display:flex;justify-content:space-between;gap:10px;
  padding:8px 0;
  border-bottom:1px dashed rgba(148,163,184,.35);
}
.line:last-child{border-bottom:none;}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}

.footer{
  margin-top:14px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  padding:8px 0;
}

/* 待办 */
.todo-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.todo-grid.compact .todo-item .todo-meta{display:none;}
.todo-col{
  border:1px solid var(--stroke);
  border-radius:20px;
  padding:12px;
  background:linear-gradient(180deg, rgba(248,250,252,1), rgba(255,255,255,1));
}
.todo-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.todo-title{font-weight:950;}
.todo-count{
  min-width:38px;
  text-align:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:#fff;
  font-weight:950;
  font-size:12px;
  color:#334155;
}
.todo-list{display:flex;flex-direction:column;gap:10px;}

.todo-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 10px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:#fff;
}
.todo-check{
  width:18px;height:18px;
  border-radius:50%;
  border:2px solid rgba(59,130,246,.55);
  background:#fff;
  cursor:pointer;
  margin-top:2px;
}
.todo-check:hover{filter:brightness(.98);}
.todo-main{flex:1;min-width:0;}
.todo-text{
  font-weight:950;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.todo-meta{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.todo-del{
  border:1px solid rgba(239,68,68,.25);
  background:rgba(239,68,68,.06);
  color:#7f1d1d;
  border-radius:999px;
  padding:7px 10px;
  font-weight:950;
  cursor:pointer;
}
.todo-del:hover{filter:brightness(.98);}

.todo-create-wide{padding-top:4px;}
.todo-create-row{margin-bottom:10px;}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr;}
  .grid2{grid-template-columns: 1fr;}
  .todo-grid{grid-template-columns: 1fr;}
  .topbar{flex-direction:column;align-items:flex-start;}
  .top-actions{width:100%;justify-content:space-between;}
}

/* ===== scroll boxes ===== */
.scroll-box{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter: stable;
}

/* 不同密度的最大高度，桌面端与移动端都能自适应 */
.scroll-sm{ max-height: clamp(140px, 22vh, 240px); }
.scroll-md{ max-height: clamp(200px, 30vh, 360px); }
.scroll-lg{ max-height: clamp(260px, 46vh, 520px); }

/* 让列表在卡片内滚动时更顺眼 */
.scroll-box .empty{ padding-bottom: 10px; }
