/* ============================================================
   学序 2.0 · 内容材质层
   原则：玻璃只属于导航层；内容用实色/发丝线/内高光，
   不再让每一张卡片都像悬浮的半透明塑料片。
   ============================================================ */

:root {
  --mat-surface: #ffffff;
  --mat-surface-2: #f7f7f9;
  --mat-surface-3: #ececf0;
  --mat-hairline: rgba(60, 60, 67, 0.2);
  --mat-hairline-soft: rgba(60, 60, 67, 0.12);
  --mat-highlight: rgba(255, 255, 255, 0.72);
  --mat-shadow:
    0 0.5px 0 var(--mat-highlight) inset,
    0 1px 2px rgba(15, 23, 42, 0.035);
  --mat-shadow-lift:
    0 0.5px 0 rgba(255, 255, 255, 0.72) inset,
    0 8px 26px rgba(15, 23, 42, 0.055),
    0 1px 2px rgba(15, 23, 42, 0.03);
  --mat-radius: 16px;
  --mat-radius-mobile: 18px;
  --mat-blue: #0a6cff;
  --mat-blue-strong: #0057d8;
  --mat-blue-soft: rgba(10, 108, 255, 0.1);
}

:root[data-theme="dark"] {
  --mat-surface: #1c1c1e;
  --mat-surface-2: #242426;
  --mat-surface-3: #2c2c2e;
  --mat-hairline: rgba(235, 235, 245, 0.2);
  --mat-hairline-soft: rgba(235, 235, 245, 0.13);
  --mat-highlight: rgba(255, 255, 255, 0.06);
  --mat-shadow:
    0 0.5px 0 var(--mat-highlight) inset,
    0 1px 2px rgba(0, 0, 0, 0.24);
  --mat-shadow-lift:
    0 0.5px 0 rgba(255, 255, 255, 0.07) inset,
    0 12px 32px rgba(0, 0, 0, 0.3);
  --mat-blue-soft: rgba(84, 151, 255, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mat-surface: #1c1c1e;
    --mat-surface-2: #242426;
    --mat-surface-3: #2c2c2e;
    --mat-hairline: rgba(235, 235, 245, 0.2);
    --mat-hairline-soft: rgba(235, 235, 245, 0.13);
    --mat-highlight: rgba(255, 255, 255, 0.06);
    --mat-shadow:
      0 0.5px 0 var(--mat-highlight) inset,
      0 1px 2px rgba(0, 0, 0, 0.24);
    --mat-shadow-lift:
      0 0.5px 0 rgba(255, 255, 255, 0.07) inset,
      0 12px 32px rgba(0, 0, 0, 0.3);
    --mat-blue-soft: rgba(84, 151, 255, 0.18);
  }
}

/* ---------------- 表面 ---------------- */
.card {
  position: relative;
  background: var(--mat-surface);
  border: 0.5px solid var(--mat-hairline-soft);
  border-radius: var(--mat-radius);
  box-shadow: var(--mat-shadow);
  overflow: hidden;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.card-pad {
  padding: 16px;
}

/* 只有主卡/浮起的摘要卡有环境阴影 */
.hero,
.proj-card,
.stat,
.auth-card {
  box-shadow: var(--mat-shadow-lift);
}

/* ---------------- 列表：发丝线内缩，不再每行一条通栏边 ---------------- */
.list-item,
.assign-item,
.settings-row,
.day-list-item {
  position: relative;
  border-bottom: 0 !important;
}

.list-item::after,
.assign-item::after,
.settings-row::after,
.day-list-item::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--mat-hairline-soft);
  pointer-events: none;
}

.list-item:last-child::after,
.assign-item:last-child::after,
.settings-row:last-child::after,
.day-list-item:last-child::after,
.card > .list-item:last-child::after {
  display: none;
}

/* 带 checkbox / 图标的一行，分隔线从文字起点开始 */
.assign-item::after {
  left: 43px;
}
.day-list-item::after {
  left: 74px;
}

.list-item {
  padding: 14px 16px;
}
.list-item.is-clickable {
  transition: background 0.12s ease;
}
.list-item.is-clickable:hover {
  background: var(--mat-surface-2);
}
.list-item.is-clickable:active,
.assign-item:active,
.day-list-item:active {
  background: var(--mat-surface-2);
}

.li-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.li-meta {
  color: var(--muted);
}

/* ---------------- 控件 ---------------- */
.btn {
  min-height: 36px;
  border-radius: 11px;
  border: 0.5px solid var(--mat-hairline-soft);
  background: var(--mat-surface);
  box-shadow: 0 0.5px 0 var(--mat-highlight) inset;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.btn:active {
  transform: scale(0.975);
  opacity: 0.92;
}
.btn-primary {
  background: var(--mat-blue);
  border-color: transparent;
  color: #fff;
  box-shadow:
    0 0.5px 0 rgba(255, 255, 255, 0.3) inset,
    0 3px 10px rgba(10, 108, 255, 0.18);
}
.btn-primary:hover {
  background: var(--mat-blue-strong);
}
.btn-soft {
  background: var(--mat-blue-soft);
  border-color: transparent;
  color: var(--accent-text);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.btn-icon {
  border-radius: 10px;
  transition: background 0.12s ease, transform 0.12s ease;
}
.btn-icon:hover {
  background: var(--mat-surface-2);
}
.btn-icon:active {
  transform: scale(0.92);
}

.input,
.select,
.textarea {
  border: 0.5px solid var(--mat-hairline);
  border-radius: 11px;
  background: var(--mat-surface);
  box-shadow: 0 0.5px 0 var(--mat-highlight) inset;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--mat-blue) 65%, var(--mat-hairline));
  box-shadow: 0 0 0 3.5px var(--mat-blue-soft);
}
.search-box {
  background: var(--mat-surface);
  border: 0.5px solid var(--mat-hairline-soft);
  border-radius: 12px;
}

.seg {
  padding: 2px;
  border-radius: 11px;
  background: var(--mat-surface-3);
  border: 0.5px solid var(--mat-hairline-soft);
}
.seg-item {
  border-radius: 9px;
}
.seg-item[aria-selected="true"] {
  background: var(--mat-surface);
  box-shadow: 0 0.5px 0 var(--mat-highlight) inset, 0 1px 3px rgba(15, 23, 42, 0.08);
}

.badge {
  border-radius: 7px;
  font-weight: 550;
}

/* ---------------- 首页/主页面的内容细节 ---------------- */
.hero {
  border: 0.5px solid var(--mat-hairline-soft);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mat-blue) 7%, var(--mat-surface)), var(--mat-surface) 62%);
}
.hero-date {
  letter-spacing: -0.035em;
}
.quick-btn {
  background: var(--mat-surface);
  border: 0.5px solid var(--mat-hairline-soft);
  box-shadow: var(--mat-shadow);
  border-radius: 16px;
}
.quick-btn:hover {
  background: var(--mat-surface-2);
  border-color: var(--mat-hairline);
  transform: translateY(-1px);
}
.quick-btn:active {
  transform: scale(0.98);
}
.proj-card {
  border: 0.5px solid var(--mat-hairline-soft);
  box-shadow: var(--mat-shadow);
}
.proj-card:hover {
  border-color: var(--mat-hairline);
  box-shadow: var(--mat-shadow-lift);
}
.proj-foot {
  border-top: 0.5px solid var(--mat-hairline-soft);
}
.stage-card {
  border: 0.5px solid var(--mat-hairline-soft);
  box-shadow: var(--mat-shadow);
}
.ai-card {
  border: 0.5px solid var(--mat-hairline-soft);
}
.ai-summary {
  background: var(--mat-surface-2);
  border-left: 0.5px solid var(--mat-hairline-soft);
}
.ai-advanced,
.ai-tool-panel {
  border-color: var(--mat-hairline-soft);
}
.ai-draft,
.ai-result {
  border: 0.5px solid var(--mat-hairline-soft);
  background: var(--mat-surface-2);
}
.settings-label {
  font-weight: 550;
}
.settings-row {
  padding: 14px 16px;
}
.settings-desc {
  line-height: 1.55;
}

/* 卡片内部不再叠第二层“白卡阴影” */
.card .card {
  box-shadow: none;
}

/* ---------------- 浮层保持玻璃，但材质更实 ---------------- */
.modal {
  background: color-mix(in srgb, var(--mat-surface) 86%, transparent);
  border: 0.5px solid var(--v2-glass-border);
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.22),
    0 0.5px 0 var(--mat-highlight) inset;
}
.modal-head {
  border-bottom: 0.5px solid var(--mat-hairline-soft);
}
.modal-foot {
  border-top: 0.5px solid var(--mat-hairline-soft);
  background: color-mix(in srgb, var(--mat-surface-2) 82%, transparent);
}

@media (max-width: 900px) {
  :root {
    --mat-radius: var(--mat-radius-mobile);
  }
  /* iOS 使用 overlay scrollbar；避免桌面 Chrome 预览里出现右侧灰线 */
  .page-scroll {
    scrollbar-width: none;
  }
  .page-scroll::-webkit-scrollbar {
    display: none;
  }
  .card {
    box-shadow: 0 0.5px 0 var(--mat-highlight) inset;
  }
  .btn {
    min-height: 40px;
  }
  .btn-sm {
    min-height: 36px;
  }
  .li-title {
    font-size: 14.5px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .modal {
    background: var(--mat-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
