:root {
    --bg: #f7f8fa;
    --surface: #fff;
    --border: #e4e7eb;
    --text: #1f2933;
    --text-muted: #6b7280;
    --accent: #2f6feb;
    --accent-soft: #eaf1ff;
    --green: #10a75f;
    --yellow: #d99a19;
    --red: #d93838;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 6px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Topbar */
.topbar {
    background: linear-gradient(180deg, #0f172a 0%, #111a2e 100%);
    color: #f8fafc;
    border-bottom: 1px solid rgba(148, 163, 184, .1);
    box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.topbar-inner {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 32px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    letter-spacing: .3px;
    white-space: nowrap;
}
.brand-icon {
    display: inline-flex;
    width: 26px; height: 26px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(59,130,246,.35);
}
.brand-text { letter-spacing: .2px; }

.nav-main {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    margin-left: 20px;
}
.nav-link, .nav-link:visited, .nav-link:link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13.5px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: background .12s ease, color .12s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.nav-link:hover, .nav-link:focus { background: rgba(255,255,255,.06); color: #fff; }
.nav-link:active { color: #fff; }
/* 下拉菜单内的 a 也一并防 visited 变色 */
.nav-dropdown-menu a:link, .nav-dropdown-menu a:visited {
    color: #cbd5e1;
}
.nav-dropdown-menu a:hover { color: #fff; }
.nav-link-primary {
    background: #2f6feb;
    color: #fff;
    padding: 7px 18px;
    margin-left: auto;
}
.nav-link-primary:hover { background: #1e5ad6; color: #fff; }

/* Dropdown — click to toggle,稳定不失焦 */
.nav-dropdown { position: relative; }
.nav-link-dropdown {
    background: transparent !important;
    border: none !important;
    color: #cbd5e1 !important;
    user-select: none;
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
    /* 覆盖 chrome 默认 button 样式 */
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    outline: none;
}
.nav-link-dropdown:hover {
    background: rgba(255,255,255,.06) !important;
    color: #fff !important;
}
.nav-dropdown.is-open .nav-link-dropdown {
    background: rgba(255,255,255,.10) !important;
    color: #fff !important;
}
.nav-link-dropdown .chevron {
    display: inline-block;
    transition: transform .15s ease;
    margin-left: 3px;
    font-size: 10px;
    color: #94a3b8;
}
.nav-dropdown.is-open .chevron { transform: rotate(180deg); color: #fff; }

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 6px;
    padding: 5px;
    display: none;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.nav-dropdown.is-open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 9px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    line-height: 1.4;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }

/* User info */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    border-left: 1px solid rgba(148, 163, 184, .15);
}
.user-name { color: #f1f5f9; font-size: 13px; font-weight: 500; }
.user-roles { display: flex; gap: 3px; flex-wrap: nowrap; max-width: 340px; overflow: hidden; }
.role-chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    opacity: .9;
}
.role-admin      { background: #7c3aed; color: #fff; }
.role-dev        { background: #059669; color: #fff; }
.role-product_ops{ background: #0284c7; color: #fff; }
.role-sales      { background: #d97706; color: #fff; }
.role-procurement{ background: #db2777; color: #fff; }
.role-biz_ops    { background: #64748b; color: #fff; }

.logout-form { display: inline; margin: 0; }
.logout-btn {
    background: transparent;
    border: 1px solid rgba(148,163,184,.3);
    color: #cbd5e1;
    width: 30px; height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .12s ease;
}
.logout-btn:hover { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.5); color: #fca5a5; }

/* Hero */
.hero {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 28px;
    margin: 28px 0 20px;
    box-shadow: var(--shadow);
    position: relative;
}
.hero-stat { min-width: 140px; }
.stat-label {
    font-size: 11.5px;
    color: var(--text-muted);
    letter-spacing: .8px;
    text-transform: uppercase;
    font-weight: 500;
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 6px;
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
    color: var(--text);
    letter-spacing: -.3px;
}
.hero-updated {
    position: absolute;
    right: 24px;
    top: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin: 0 0 20px;
}
.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 18px;
    font: inherit;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    top: 2px;
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 16px;
    letter-spacing: .3px;
}
h2:first-child { margin-top: 24px; }
h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 12px;
}
h3:first-child { margin-top: 0; }
.hint { color: var(--text-muted); font-size: 13px; margin: -8px 0 12px; }
.empty { color: var(--text-muted); text-align: center; padding: 40px; }

/* Table */
.table {
    width: 100%;
    background: var(--surface);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 13px;
}
.table thead th {
    background: #f9fafb;
    text-align: left;
    padding: 9px 14px;
    font-weight: 600;
    font-size: 11.5px;
    color: var(--text-muted);
    letter-spacing: .5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}
.table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
    line-height: 1.5;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f9fafb; }
.table tbody tr:hover td { color: var(--text); }
.table tbody tr.clickable-row { cursor: pointer; transition: background .1s ease; }
.table tbody tr.clickable-row:hover { background: #eff6ff; }
.table tbody tr.clickable-row:hover td:first-child { color: var(--accent); }

/* id 列窄化(第一列如果是数字 id) */
.table th:first-child, .table td:first-child {
    color: var(--text-muted);
    font-size: 12px;
    font-family: "SF Mono", Menlo, monospace;
}

.nowrap { white-space: nowrap; }
.cell-notes {
    color: #374151;
    font-size: 12.5px;
    line-height: 1.5;
    max-width: 480px;
    white-space: normal;
    word-break: break-word;
}

code {
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
    font-size: 12.5px;
    background: #f2f4f7;
    padding: 1px 6px;
    border-radius: 4px;
}
.tag-strong { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.arrow { color: var(--text-muted); margin: 0 4px; }
.tag-link { text-decoration: none; }
.tag-link:hover code { background: #d5e3ff; color: var(--accent); text-decoration: underline; }
.tag-link:hover code.tag-strong { background: var(--accent); color: #fff; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }

/* Release card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.release-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px 16px;
    color: var(--text);
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease;
    box-shadow: var(--shadow);
}
.release-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.release-card.risk-green   { border-left-color: var(--green); }
.release-card.risk-yellow  { border-left-color: var(--yellow); }
.release-card.risk-red     { border-left-color: var(--red); }
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.card-tag {
    font-size: 17px;
    font-weight: 600;
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
}
.card-risk {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.card-reason {
    font-size: 13px;
    line-height: 1.55;
    color: #37414f;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Release detail */
.back {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    margin: 24px 0 12px;
}
.back:hover { color: var(--accent); }

.release-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--border);
    border-radius: 10px;
    padding: 22px 26px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.release-hero.risk-green  { border-left-color: var(--green); }
.release-hero.risk-yellow { border-left-color: var(--yellow); }
.release-hero.risk-red    { border-left-color: var(--red); }

.release-hero h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
}
.release-meta {
    color: var(--text-muted);
    font-size: 13px;
}
.release-meta a { color: var(--accent); text-decoration: none; }

.release-hero-risk {
    text-align: right;
    min-width: 260px;
    max-width: 340px;
}
.risk-label { font-size: 12px; color: var(--text-muted); }
.risk-value { font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.risk-reason { font-size: 13px; color: #37414f; line-height: 1.5; }

.doc-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.doc-block h2 { margin-top: 0; }
.source-block { padding: 12px 20px; }
.source-line { font-size: 12px; color: var(--text-muted); }

/* Markdown rendering */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 20px; margin-bottom: 8px;
}
.markdown-body h1 { font-size: 20px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body p { margin: 8px 0; line-height: 1.65; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; line-height: 1.7; }
.markdown-body li { margin: 2px 0; }
.markdown-body strong { color: #0f172a; }
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.markdown-body th { background: #f2f4f7; }
.markdown-body code {
    background: #f2f4f7;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12.5px;
}
.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Sub-sections inside pending tab */
.sub-section { margin: 20px 0 28px; }
.sub-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.sub-section-head h2 { margin: 0; }
.sub-section .count {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}
.sub-hint { color: var(--text-muted); font-size: 13px; }
.empty-inline {
    background: #f0fdf4;
    color: #166534;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    font-size: 13px;
}

.sub-section details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    padding: 4px 0;
    outline: none;
}
.sub-section details > summary::-webkit-details-marker { display: none; }
.sub-section details > summary::before {
    content: "▶";
    color: var(--text-muted);
    font-size: 11px;
    transition: transform .15s ease;
    display: inline-block;
    width: 12px;
}
.sub-section details[open] > summary::before { transform: rotate(90deg); }

/* Release body details/summary */
.doc-block details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    padding: 4px 0;
    outline: none;
}
.doc-block details > summary::-webkit-details-marker { display: none; }
.doc-block details > summary::before {
    content: "▶";
    color: var(--text-muted);
    font-size: 11px;
    transition: transform .15s ease;
    display: inline-block;
    width: 12px;
}
.doc-block details[open] > summary::before { transform: rotate(90deg); }
.doc-block details > summary h2 { margin: 0; }
.release-body-meta {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: normal;
}
.markdown-body.release-body {
    max-height: 800px;
    overflow-y: auto;
    padding: 16px 20px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 12px;
}
.markdown-body.release-body pre {
    background: #f2f4f7;
    padding: 12px 14px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
}

/* Auth pages */
.auth-card {
    max-width: 400px;
    margin: 60px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 36px;
    box-shadow: var(--shadow);
}
.auth-card h1 {
    margin: 0 0 8px;
    font-size: 22px;
    text-align: center;
}
.auth-hint { color: var(--text-muted); font-size: 13px; text-align: center; margin: 0 0 20px; }
.auth-form label {
    display: block;
    margin-bottom: 14px;
}
.auth-form label > span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.auth-form input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47,111,235,.15);
}
.btn-primary {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}
.btn-primary:hover { background: #1e5ad6; }
.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }


/* Admin forms */
.admin-form-row {
    display: grid;
    grid-template-columns: 200px 140px 220px 1fr auto;
    gap: 10px;
    align-items: center;
}
.admin-form-row input[type=email],
.admin-form-row input[type=text],
.admin-form-row input[type=password] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
}
.role-checkbox { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; }
.role-checkbox label { display: inline-flex; align-items: center; gap: 4px; }

.role-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.role-tag-inline {
    display: inline-flex;
    align-items: center;
    background: #eef2f7;
    padding: 2px 4px 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    gap: 4px;
}
.role-tag-inline button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
}
.role-tag-inline button:hover { color: var(--red); }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* === 通用筛选栏 === */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-wrap: wrap;
}
.filter-input {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: var(--text);
    height: 34px;
    box-sizing: border-box;
    line-height: 1;
}
.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47,111,235,.12);
}
.filter-btn {
    padding: 0 18px;
    height: 34px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
}
.filter-btn:hover { background: #1e5ad6; }
.filter-reset {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    padding: 0 10px;
    margin-left: 4px;
}
.filter-reset:hover { color: var(--accent); text-decoration: underline; }

/* === 统一空态 === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
    opacity: .6;
}
.empty-state-title {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 4px;
}
.empty-state-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}
.empty-state-hint code {
    font-size: 11.5px;
    background: #f2f4f7;
    padding: 1px 6px;
    border-radius: 3px;
}

/* 版本详情:已有活跃申请提示 */
.active-request-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all .12s ease;
}
.active-request-badge:hover {
    background: #fde68a;
    border-color: #f59e0b;
    color: #78350f;
}

/* === 状态徽章色阶 === */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: .2px;
}
.status-badge.status-blue   { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.status-badge.status-purple { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.status-badge.status-amber  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status-badge.status-orange { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.status-badge.status-green  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.status-badge.status-cyan   { background: #cffafe; color: #155e75; border: 1px solid #a5f3fc; }
.status-badge.status-emerald{ background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.status-badge.status-red    { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-badge.status-slate  { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-badge.status-rose   { background: #ffe4e6; color: #9f1239; border: 1px solid #fecdd3; }

/* Upgrade pages */
.upgrade-target { display: flex; gap: 24px; flex-wrap: wrap; }
.upgrade-target > div { display: flex; align-items: center; gap: 8px; }
.upgrade-target .label { color: var(--text-muted); font-size: 12px; }
.risk-reason-box {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fef9e7;
    border-left: 3px solid var(--yellow);
    border-radius: 4px;
    font-size: 13px;
    color: #78350f;
}

.upgrade-form .field { display: block; margin-bottom: 14px; }
.upgrade-form .field > span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.upgrade-form input[type=datetime-local],
.upgrade-form input[type=text],
.upgrade-form textarea,
.upgrade-form select,
.field input[type=datetime-local],
.field input[type=text],
.field textarea,
.field select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font: inherit;
    font-size: 13px;
}
.field textarea { font-family: inherit; resize: vertical; }
.inline-form {
    margin-top: 14px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.inline-form .field { max-width: 500px; }
.btn-warn {
    padding: 8px 16px;
    background: var(--yellow);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    margin-top: 8px;
}
.btn-warn:hover { background: #b8850e; }

.round-block { margin-bottom: 24px; }
.round-block h3 { margin: 12px 0 8px; font-size: 15px; }
.checklist-cell { font-size: 12px; color: #4b5563; }
.decision-box {
    margin-top: 8px;
    padding: 10px 14px;
    background: #eef2ff;
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    font-size: 13px;
}

/* === 轮次时间轴 · 卡片式 === */
.rounds-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.round-card {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    position: relative;
}
.round-card.round-current {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59,130,246,.08);
}
.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(148,163,184,.4);
}
.round-number {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}
.round-decision {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}
.decision-time {
    font-family: "SF Mono", Menlo, monospace;
    background: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-weight: 500;
}
.decision-kind {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 500;
}
.decision-rolling { background: #dcfce7; color: #166534; }
.decision-full_stop { background: #fee2e2; color: #991b1b; }

.round-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.role-mini-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12.5px;
    transition: all .12s ease;
}
.role-mini-card.role-waiting {
    background: #f9fafb;
    border-style: dashed;
    color: var(--text-muted);
}
.role-mini-card.role-confirmed { border-left: 3px solid var(--green); }
.role-mini-card.role-objected {
    border-left: 3px solid var(--red);
    background: #fef2f2;
}
.role-mini-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.role-mini-name { font-weight: 500; color: var(--text); }
.role-waiting .role-mini-name { color: var(--text-muted); }
.role-mini-status {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    background: #e5e7eb;
    color: #4b5563;
}
.role-confirmed .role-mini-status { background: #dcfce7; color: #166534; }
.role-objected .role-mini-status { background: #fee2e2; color: #991b1b; }
.role-mini-body { font-size: 11.5px; color: #4b5563; }
.role-mini-user { color: var(--text-muted); font-size: 11px; }
.role-mini-time {
    margin-top: 3px;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: #374151;
}
.role-mini-reason {
    margin-top: 4px;
    padding: 4px 6px;
    background: #fee2e2;
    color: #7f1d1d;
    border-radius: 3px;
    font-size: 11px;
}
.role-mini-details {
    margin-top: 6px;
    font-size: 11px;
}
.role-mini-details summary {
    cursor: pointer;
    color: var(--accent);
    user-select: none;
    padding: 2px 0;
}
.role-mini-details .cl-block {
    margin-top: 3px;
    padding: 4px 6px;
    background: #f3f4f6;
    border-radius: 3px;
    color: #374151;
    line-height: 1.5;
}

.round-ai-reason {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: #f5f3ff;
    border-left: 3px solid #8b5cf6;
    border-radius: 4px;
    font-size: 13px;
}
.ai-badge {
    background: #8b5cf6;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
    height: fit-content;
}
.ai-reason-text { color: #4c1d95; line-height: 1.55; flex: 1; }

.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f2f4f7;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.task-list li:last-child { border-bottom: none; }

/* === 通用过滤 tab 条 === */
.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-wrap: wrap;
}
.filter-tab {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 5px;
    transition: all .12s ease;
    white-space: nowrap;
}
.filter-tab:hover { background: #f2f4f7; color: var(--text); }
.filter-tab.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

/* === 响应式 · 窄屏适配 === */
@media (max-width: 900px) {
    .container { padding: 0 16px; }
    .topbar-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    .brand-text { display: none; }  /* 只保留 icon */
    .nav-main { order: 3; width: 100%; gap: 2px; overflow-x: auto; }
    .nav-link { padding: 6px 10px; font-size: 12.5px; }
    .topbar-user { padding-left: 0; border-left: none; margin-left: auto; }
    .user-roles { display: none; }  /* 窄屏隐藏 role chip */

    .hero { flex-wrap: wrap; gap: 16px; padding: 16px 20px; }
    .hero-stat { flex: 1 1 45%; min-width: 100px; }
    .hero-updated { position: static; margin-top: 8px; }

    /* 表格滚动 */
    .table { display: block; overflow-x: auto; white-space: nowrap; }
    .table td, .table th { white-space: nowrap; }
    .cell-notes { max-width: 300px; white-space: normal; }

    /* release hero 两列变一列 */
    .release-hero { flex-direction: column; gap: 12px; }
    .release-hero-risk { text-align: left; }

    /* upgrade target 三列自适应 */
    .upgrade-target { flex-direction: column; gap: 10px; }
    .admin-form-row { grid-template-columns: 1fr; }

    /* 轮次卡片 role 网格改成两列 */
    .round-roles { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
    .round-roles { grid-template-columns: 1fr; }
    .hero-stat { flex: 1 1 100%; }
    .doc-block { padding: 16px 18px; }
}

.footer {
    margin: 40px auto 24px;
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}
