:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #0f1011;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.06);
  --surface-soft: rgba(255,255,255,0.025);
  --text: #f7f8f8;
  --muted: #8a8f98;
  --muted-strong: #d0d6e0;
  --line: rgba(255,255,255,0.08);
  --line-soft: rgba(255,255,255,0.05);
  --accent: #7170ff;
  --accent-bg: #5e6ad2;
  --accent-hover: #828fff;
  --success: #10b981;
  --warning: #fbbf24;
  --danger: #fb7185;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 18px 60px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.03);
  --page-gutter: clamp(1rem, 2.2vw, 3rem);
  --page-max: none;
  --content-max: 100%;
  --tool-max: 100%;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: Calibri, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Hiragino Sans GB", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); font-size: clamp(17px, 1rem + 0.18vw, 19px); }
body {
  background:
    radial-gradient(circle at top left, rgba(113,112,255,0.22), transparent 32rem),
    radial-gradient(circle at 78% 8%, rgba(16,185,129,0.09), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "cv01", "ss03";
  line-height: 1.6;
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0 var(--page-gutter) 2rem;
  width: 100%;
}
body.full-bleed { margin: 0; max-width: none; padding: 0 var(--page-gutter) 1rem; }
body.full-bleed header { margin: 0 0 1rem; max-width: none; padding: 1rem 0; width: 100%; }
body.full-bleed main { margin: 0; max-width: none; width: 100%; }
body.embedded-graph-page main { max-width: none; }
a { color: var(--accent-hover); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--text); }
h1, h2, h3 { letter-spacing: -0.04em; line-height: 1.05; }
h1 { font-size: clamp(2.15rem, 5vw, 4rem); font-weight: 510; margin: 0.2rem 0 1rem; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 510; }
h3 { font-size: 1.08rem; font-weight: 590; }
header.app-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(8,9,10,0.72);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { align-items: center; display: flex; gap: 0.65rem; text-decoration: none; }
.brand-mark {
  background: linear-gradient(135deg, var(--accent-bg), #8b5cf6);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 11px;
  box-shadow: 0 10px 24px rgba(94,106,210,0.28);
  color: #fff;
  display: inline-grid;
  font-weight: 590;
  height: 2.1rem;
  place-items: center;
  width: 2.1rem;
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-name { color: var(--text); font-weight: 590; }
.brand-stage { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.primary-nav, .user-nav, .staff-nav { align-items: center; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.primary-nav { overflow-x: auto; max-width: 100%; }
.nav-shell { align-items: center; display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 1rem; justify-content: flex-end; }
.primary-nav a, .user-nav a, .staff-nav a {
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 510;
  text-decoration: none;
}
.primary-nav a:hover, .user-nav a:hover, .staff-nav a:hover { color: var(--text); }
.session-form { display: inline; }
.badge, .staff-ops, .tag-chip, .meta-chip {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 510;
  gap: 0.35rem;
  padding: 0.22rem 0.62rem;
}
.badge { background: rgba(113,112,255,0.12); color: #dfe2ff; }
.staff-ops { background: rgba(251,191,36,0.09); color: #fcd982; }
.tag-chip { background: rgba(255,255,255,0.035); color: var(--muted-strong); }
.meta-chip { background: rgba(16,185,129,0.08); color: #b7f7dc; }
.status-dot { background: var(--success); border-radius: 999px; box-shadow: 0 0 0 4px rgba(16,185,129,0.12); display: inline-block; height: 0.5rem; width: 0.5rem; }
header.app-header, main {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  width: 100%;
}
main { margin-top: 0; margin-bottom: 0; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent-hover); font-family: var(--mono); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.card {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1rem 0;
  padding: 1.05rem;
}
.hero {
  background:
    linear-gradient(135deg, rgba(113,112,255,0.16), rgba(255,255,255,0.035) 42%, rgba(16,185,129,0.08)),
    rgba(255,255,255,0.035);
  overflow: hidden;
  padding: clamp(1.2rem, 3vw, 2rem);
  position: relative;
}
.hero::after { background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 58%); content: ""; height: 18rem; position: absolute; right: -6rem; top: -8rem; width: 18rem; }
.hero > * { position: relative; z-index: 1; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.metric-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 1.2rem; }
.metric-card { background: rgba(255,255,255,0.035); border: 1px solid var(--line-soft); border-radius: 12px; padding: 0.9rem; }
.metric-value { color: var(--text); display: block; font-size: 1.65rem; font-weight: 590; letter-spacing: -0.04em; }
.metric-label { color: var(--muted); display: block; font-size: 0.84rem; }
.section-heading { align-items: end; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; margin-top: 1.4rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading.flush-top { margin-top: 0; }
.button-link { background: none; border: none; color: var(--accent-hover); cursor: pointer; font: inherit; font-weight: 510; padding: 0; text-decoration: underline; }
.discovery-form { align-items: end; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.discovery-form label { color: var(--muted-strong); display: grid; font-size: 0.88rem; gap: 0.25rem; }
.search-field { flex: 1 1 22rem; }
.search-input { width: 100%; }
input, select {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 0.55rem 0.66rem;
}
input::placeholder { color: var(--muted); }
button[type="submit"]:not(.button-link), .phase20-card-action {
  background: var(--accent-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 510;
  padding: 0.52rem 0.82rem;
  text-decoration: none;
}
.phase20-card-action:hover { background: var(--accent-hover); color: #fff; }
.empty-state { background: rgba(255,255,255,0.025); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.1rem; }
.content-card, .tool-card { display: flex; flex-direction: column; min-height: 13rem; }
.real-deliverable-card { border-color: rgba(16,185,129,0.2); }
.placeholder-card { background: rgba(255,255,255,0.025); border-style: dashed; box-shadow: none; opacity: 0.84; }
.content-card h3, .tool-card h3 { margin-top: 0; }
.content-meta { color: var(--muted); font-size: 0.9rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.42rem; margin: 0.75rem 0; }
.card-footer { align-items: center; display: flex; justify-content: space-between; margin-top: auto; padding-top: 0.85rem; }
.content-detail-shell { max-width: none; width: 100%; }
.breadcrumb-link { color: var(--muted-strong); display: inline-flex; font-size: 0.9rem; margin-bottom: 1rem; text-decoration: none; }
.detail-meta-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1rem 0; }
.detail-meta-item { background: rgba(255,255,255,0.028); border: 1px solid var(--line-soft); border-radius: 10px; padding: 0.75rem; }
.detail-meta-label { color: var(--muted); display: block; font-family: var(--mono); font-size: 0.72rem; margin-bottom: 0.2rem; text-transform: uppercase; }
.detail-body { color: var(--muted-strong); font-size: 1.04rem; line-height: 1.75; margin-top: 1.2rem; }
.attachment-panel { margin-top: 1.25rem; }
.preview-action-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 0.9rem 0 1rem; }
.attachment-group-grid { display: grid; gap: 1rem; }
.attachment-group { background: rgba(255,255,255,0.022); border: 1px solid var(--line-soft); border-radius: 12px; padding: 0.85rem; }
.attachment-group-heading { align-items: center; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; }
.attachment-group-heading h3 { margin: 0; }
.attachment-list { list-style: none; margin: 0; padding: 0; }
.attachment-list li { align-items: center; display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-top: 1px solid var(--line-soft); }
.path-chip { background: rgba(255,255,255,0.035); border: 1px solid var(--line-soft); border-radius: 10px; color: #dfe2ff; display: block; font-family: var(--mono); font-size: 0.82rem; overflow-wrap: anywhere; padding: 0.75rem; }
.html-preview-grid { display: grid; gap: 1rem; }
.html-preview-card { background: rgba(255,255,255,0.025); border: 1px solid var(--line-soft); border-radius: 12px; margin: 0; padding: 0.75rem; }
.html-preview-card figcaption { color: var(--muted-strong); font-family: var(--mono); font-size: 0.78rem; margin-bottom: 0.55rem; }
.html-preview-frame { background: #050607; border: 1px solid var(--line); border-radius: 10px; display: block; height: clamp(680px, 78vh, 1080px); width: 100%; }
.page-shell { max-width: none; width: 100%; }
.plan-card, .support-card, .profile-card { min-height: 11rem; }
.private-support-channel { border-color: rgba(113,112,255,0.26); }
.product-tool-shell { margin: 0 auto; width: min(100%, var(--tool-max)); }
.embedded-graph-shell { margin: 0 auto; width: min(100%, var(--tool-max)); }
.embedded-graph-header { align-items: end; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin: 0 0 0.75rem; }
.embedded-graph-header h1 { margin-bottom: 0.25rem; }
.tool-status-strip {
  align-items: center;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: #d0d6e0;
  display: inline-flex;
  font-size: 0.82rem;
  gap: 0.5rem;
  padding: 0.36rem 0.72rem;
}
.embedded-graph-frame {
  background: #08090a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 22px 80px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
  display: block;
  height: calc(100vh - 140px);
  min-height: 720px;
  width: 100%;
}
@media (max-width: 720px) {
  body { padding: 0 0.75rem 1.5rem; }
  header.app-header, .nav-shell { align-items: flex-start; flex-direction: column; }
  .primary-nav, .user-nav, .staff-nav { gap: 0.55rem; }
  .primary-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .primary-nav a { background: rgba(255,255,255,0.035); border: 1px solid var(--line-soft); border-radius: 9px; padding: 0.42rem 0.5rem; text-align: center; }
  .discovery-form { align-items: stretch; flex-direction: column; }
  .metric-grid, .grid.two, .grid.three, .detail-meta-grid { grid-template-columns: 1fr; }
  .card-footer, .attachment-list li { align-items: flex-start; flex-direction: column; }
}
