/* ===== ZY Labs Style v1 + Research Data Annotation System ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, "PingFang SC", "SF Pro Display", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #111111;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "JetBrains Mono", "Fira Code", "SF Mono", "Menlo", monospace; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 48px; } }

/* --- Navigation --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid #F0F0F0;
  padding: 0 24px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-size: 14px; font-weight: 600; color: #111111;
  text-decoration: none; white-space: nowrap;
  letter-spacing: -0.01em;
}
.nav-brand span { color: #999999; font-weight: 400; margin-left: 8px; font-size: 12px; }
.nav-links { display: none; gap: 4px; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 13px; font-weight: 500; color: #666666;
  text-decoration: none; padding: 6px 14px; border-radius: 9999px;
  transition: all 200ms ease;
}
.nav-links a:hover { color: #111111; background: #F5F5F5; }
.nav-links a.active { color: #111111; background: #F5F5F5; }

/* --- Top banner (mother site) --- */
.top-banner {
  background: #FAFAFA;
  border-bottom: 1px solid #F0F0F0;
  font-size: 12px;
  color: #666666;
  padding: 6px 24px;
  text-align: center;
}
.top-banner a {
  color: #111111;
  text-decoration: none;
  font-weight: 500;
}
.top-banner a:hover { text-decoration: underline; }

/* --- Version bar --- */
.version-bar {
  font-size: 12px;
  color: #999999;
  padding: 10px 0;
  border-top: 1px solid #F0F0F0;
  margin-top: 24px;
}

/* Mobile nav */
.nav-toggle { display: flex; background: none; border: none; cursor: pointer; padding: 8px; }
@media (min-width: 768px) { .nav-toggle { display: none; } }
.nav-toggle svg { width: 20px; height: 20px; stroke: #111111; }
.mobile-nav {
  display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
  background: #FFFFFF; z-index: 99; padding: 24px;
  flex-direction: column; gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 15px; font-weight: 500; color: #111111;
  text-decoration: none; padding: 14px 16px; border-radius: 12px;
  transition: background 200ms ease;
}
.mobile-nav a:hover { background: #F5F5F5; }
.mobile-nav a.active { background: #F5F5F5; }

/* --- Typography --- */
h1 { font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 16px; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 12px; }
h4 { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
  h4 { font-size: 18px; }
}
p { margin-bottom: 12px; color: #111111; }
.text-secondary { color: #666666; }
.text-tertiary { color: #999999; }
.text-sm { font-size: 13px; line-height: 1.5; }
.text-xs { font-size: 12px; line-height: 1.4; }

/* --- Sections --- */
.section { padding: 48px 0; }
.section-gray { background: #FAFAFA; }
.section-mint { background: #F0F7F4; }
.section-blue { background: #F0F4F8; }
.section-pink { background: #FFF0F0; }

/* --- Status Tags (Research) --- */
.status-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; line-height: 1;
  padding: 5px 12px; border-radius: 9999px; white-space: nowrap;
}
.tag-actual { background: #E8F5E9; color: #2E7D32; }
.tag-plan { background: #FFF3E0; color: #E65100; border: 1px solid #F5A623; }
.tag-proxy { background: #F5F5F5; color: #999999; border: 1px dashed #CCCCCC; }
.tag-monitor { background: #E3F2FD; color: #1565C0; border: 1px dashed #90CAF9; }
.tag-missing { background: #FFEBEE; color: #C62828; }
.tag-verified { background: #E8F5E9; color: #2E7D32; }
.tag-partial { background: #FFF8E1; color: #F57F17; border: 1px dashed #FFD54F; }

/* --- Model Layer Tags --- */
.layer-tag {
  display: inline-flex; align-items: center;
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
  font-size: 11px; font-weight: 500; line-height: 1;
  padding: 3px 10px; border-radius: 4px; white-space: nowrap;
}
.layer-p0 { background: #E8F5E9; color: #1B5E20; }
.layer-plan { background: #FFF3E0; color: #E65100; }
.layer-sensitivity { background: #FBE9E7; color: #BF360C; }
.layer-p1 { background: #E3F2FD; color: #0D47A1; }
.layer-p2 { background: #E8EAF6; color: #283593; border: 1px dashed #C5CAE9; }
.layer-monitor { background: #F5F5F5; color: #999999; border: 1px dashed #CCCCCC; }

/* --- Confidence Badges --- */
.confidence {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 9999px;
}
.conf-high { background: #E8F5E9; color: #2E7D32; }
.conf-mid { background: #FFF8E1; color: #F57F17; }
.conf-mid-low { background: #FFF3E0; color: #E65100; }
.conf-low { background: #FBE9E7; color: #BF360C; }
.conf-na { background: #F5F5F5; color: #999999; }
.conf-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.conf-high .conf-dot { background: #2E7D32; }
.conf-mid .conf-dot { background: #F57F17; }
.conf-mid-low .conf-dot { background: #E65100; }
.conf-low .conf-dot { background: #BF360C; }
.conf-na .conf-dot { background: #999999; }

/* --- Cards --- */
.card {
  background: #FFFFFF; border: 1px solid #F0F0F0;
  border-radius: 16px; padding: 24px;
  transition: border-color 200ms ease;
}
.card:hover { border-color: #E0E0E0; }
.card-gray { background: #F5F5F5; border: none; }
.card-mint { background: #F0F7F4; border: 1px solid #D7EDE0; }
.card-blue { background: #F0F4F8; border: 1px solid #D6E4F0; }
.card-pink { background: #FFF0F0; border: 1px solid #FFD6D6; }

/* Proxy-degraded card */
.card-proxy {
  background: #FAFAFA; border: 1px dashed #CCCCCC;
  border-radius: 16px; padding: 24px; opacity: 0.75;
}

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 768px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; } }

/* --- Judgment Cards (Homepage) --- */
.judgment-card {
  background: #FFFFFF; border: 1px solid #F0F0F0;
  border-radius: 16px; padding: 20px; position: relative;
  display: flex; flex-direction: column; gap: 8px;
}
.judgment-card .jc-signal { font-size: 20px; font-weight: 600; line-height: 1.3; }
.judgment-card .jc-detail { font-size: 13px; color: #666666; line-height: 1.5; }
.judgment-card .jc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.judgment-card .jc-conf { position: absolute; top: 16px; right: 16px; }

/* --- Resonance Matrix --- */
.matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix-table th {
  text-align: left; font-weight: 600; font-size: 12px; color: #666666;
  padding: 10px 12px; border-bottom: 2px solid #E5E5E5;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.matrix-table td {
  padding: 10px 12px; border-bottom: 1px solid #F0F0F0;
  vertical-align: top; line-height: 1.5;
}
.matrix-table tr:last-child td { border-bottom: none; }
.matrix-table .dim-name { font-weight: 500; white-space: nowrap; }

/* --- Timeline --- */
.timeline { display: flex; gap: 0; overflow-x: auto; padding: 16px 0; -webkit-overflow-scrolling: touch; }
.timeline::-webkit-scrollbar { height: 4px; }
.timeline::-webkit-scrollbar-thumb { background: #E5E5E5; border-radius: 2px; }
.tl-node {
  flex: 0 0 auto; min-width: 100px; text-align: center;
  padding: 12px 16px; cursor: pointer; border-top: 3px solid transparent;
  transition: all 200ms ease; position: relative;
}
.tl-node:hover { background: #F5F5F5; border-radius: 0 0 8px 8px; }
.tl-node.tl-decline { border-top-color: #2E7D32; }
.tl-node.tl-balance { border-top-color: #F57F17; }
.tl-node.tl-sensitive { border-top-color: #E65100; }
.tl-node.tl-na { border-top-color: #CCCCCC; }
.tl-year { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.tl-dir { font-size: 11px; font-weight: 500; margin-bottom: 4px; }
.tl-tags { display: flex; flex-direction: column; gap: 2px; align-items: center; }

/* --- Detail panels (accordion) --- */
.detail-panel { display: none; margin-top: 16px; }
.detail-panel.open { display: block; }
.dp-section { margin-bottom: 20px; }
.dp-section h4 { font-size: 13px; font-weight: 600; color: #666666; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.dp-content { font-size: 14px; line-height: 1.6; color: #333333; }

/* --- Data Level Table --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-weight: 600; font-size: 12px; color: #666666;
  padding: 10px 12px; border-bottom: 2px solid #E5E5E5;
  background: #FAFAFA;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid #F0F0F0; vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }

/* --- Bullet list --- */
.bullet-list { list-style: none; padding: 0; }
.bullet-list li { padding: 8px 0; border-bottom: 1px solid #F0F0F0; font-size: 14px; line-height: 1.6; }
.bullet-list li:last-child { border-bottom: none; }
.bullet-list li strong { color: #111111; }

/* --- Forbidden / Allowed comparison --- */
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.compare-allowed { background: #F0F7F4; border-radius: 12px; padding: 16px; }
.compare-forbidden { background: #FFF0F0; border-radius: 12px; padding: 16px; }
.compare-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.compare-allowed .compare-label { color: #2E7D32; }
.compare-forbidden .compare-label { color: #C62828; }
.compare-text { font-size: 14px; line-height: 1.5; }

/* --- Pending items --- */
.pending-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; border-radius: 12px; background: #FFFFFF;
  border: 1px solid #F0F0F0; margin-bottom: 8px;
}
.pending-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
}
.pending-dot.waiting { background: #CCCCCC; }
.pending-dot.partial { background: #F5A623; }
.pending-dot.done { background: #07C160; }
.pending-title { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.pending-impact { font-size: 13px; color: #666666; }

/* --- Misc --- */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }
.flex-col { display: flex; flex-direction: column; }
.divider { height: 1px; background: #F0F0F0; margin: 32px 0; }

/* --- Footer --- */
.footer {
  padding: 32px 0; border-top: 1px solid #F0F0F0;
  font-size: 12px; color: #999999; line-height: 1.6;
}
.footer a { color: #666666; text-decoration: none; }
.footer a:hover { color: #111111; }

/* --- Proxy strikethrough for values --- */
.proxy-val { color: #999999; text-decoration: none; }
.proxy-val::after { content: ""; display: block; width: 100%; height: 1px; background: #CCCCCC; position: relative; top: -1px; }

/* --- Accordion --- */
.accordion-trigger {
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 16px 0; text-align: left; font-size: 15px; font-weight: 500;
  color: #111111; border-bottom: 1px solid #F0F0F0;
  display: flex; justify-content: space-between; align-items: center;
}
.accordion-trigger:hover { color: #333333; }
.accordion-trigger svg { width: 16px; height: 16px; stroke: #999999; transition: transform 200ms ease; flex-shrink: 0; }
.accordion-trigger.open svg { transform: rotate(180deg); }
.accordion-body { display: none; padding: 16px 0; }
.accordion-body.open { display: block; }

/* --- Highlight box --- */
.highlight-box {
  background: #F0F7F4; border-left: 3px solid #07C160;
  border-radius: 0 12px 12px 0; padding: 16px 20px;
  font-size: 14px; line-height: 1.6;
}
.highlight-box.warning { background: #FFF8E1; border-left-color: #F5A623; }
.highlight-box.danger { background: #FFF0F0; border-left-color: #E54D42; }

/* --- Section label --- */
.section-label {
  font-size: 11px; font-weight: 600; color: #999999;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}

/* --- Year detail card (conclusions page) --- */
.year-detail {
  background: #FFFFFF; border: 1px solid #F0F0F0;
  border-radius: 16px; padding: 24px; margin-bottom: 16px;
}
.year-detail .yd-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.year-detail .yd-verdict { font-size: 18px; font-weight: 600; }
.year-detail .yd-sub { font-size: 13px; color: #666666; margin-top: 4px; line-height: 1.6; }
.year-detail .yd-evidence { margin-top: 12px; font-size: 13px; color: #444444; line-height: 1.6; }
.year-detail .yd-boundary { margin-top: 12px; padding: 12px 16px; background: #FFF0F0; border-radius: 8px; font-size: 13px; color: #C62828; }

/* --- Mobile responsive tables --- */
@media (max-width: 767px) {
  .matrix-table, .data-table { font-size: 12px; }
  .matrix-table th, .matrix-table td,
  .data-table th, .data-table td { padding: 8px 6px; }
  .compare-pair { grid-template-columns: 1fr; }
}