/* PKU Global Hub - Prototype Shared Styles */
/* Design tokens extracted from index.html + app layout system */

:root {
    /* Brand colors */
    --pku-red: #94070A;
    --pku-red-dark: #6B0507;
    --pku-red-light: #B71C1C;
    --pku-red-50: #FDF2F2;
    --pku-gold: #C9A227;
    --pku-gold-light: #E8D58A;
    --pku-cream: #FDF8F3;
    --pku-warm-white: #FFFCF8;

    /* Neutral colors */
    --text-dark: #1A1A1A;
    --text-gray: #5A5A5A;
    --text-light: #888888;
    --text-muted: #AAAAAA;
    --border-light: #E8E0D8;
    --border: #D9D0C7;
    --bg-light: #F5F0EB;
    --bg-soft: #FAF7F4;
    --white: #FFFFFF;

    /* Semantic colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --success-dark: #047857;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #B45309;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --danger-dark: #B91C1C;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-red: 0 12px 40px rgba(148,7,10,0.18);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --container-max: 1400px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--pku-cream);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Icons: i-* = Koboyo Ink brush; u-* = compact interface line icons */
.ico,
.ui-ico {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: none;
}

.ico {
    width: 1.3em;
    height: 1.3em;
    fill: currentColor;
}

.ui-ico {
    width: 1em;
    height: 1em;
    fill: none;
}

.nav-link .icon .ico,
.role-avatar-mini .ico,
.notification-icon .ico {
    width: 20px;
    height: 20px;
}

.icon-btn .ico,
.icon-btn .ui-ico {
    width: 19px;
    height: 19px;
}

.stat-icon .ico,
.stat-icon .ui-ico {
    width: 24px;
    height: 24px;
}

.toolbar-btn .ico,
.toolbar-btn .ui-ico {
    width: 18px;
    height: 18px;
}

.empty-state .icon .ico,
.empty-state .icon .ui-ico {
    width: 48px;
    height: 48px;
}

.btn .ico,
.btn .ui-ico {
    width: 1.1em;
    height: 1.1em;
}

.card-title .ico,
.card-title .ui-ico {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.15em;
}

.card-body .ico,
.card-body .ui-ico {
    width: 1.1em;
    height: 1.1em;
}

.workflow-step .ico {
    width: 24px;
    height: 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
p { color: var(--text-gray); }

a {
    color: var(--pku-red);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover { color: var(--pku-red-dark); }

/* Layout: App Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--pku-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-brand {
    font-weight: 700;
    color: var(--pku-red);
    font-size: 1rem;
    line-height: 1.2;
}

.sidebar-brand small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 0 12px 8px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: var(--pku-red-50);
    color: var(--pku-red);
}

.nav-link.active {
    background: var(--pku-red);
    color: var(--white);
    box-shadow: var(--shadow-red);
}

.nav-link .icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-light);
}

.role-card-mini {
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.role-card-mini:hover {
    border-color: var(--pku-red);
    background: var(--pku-red-50);
}

.role-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pku-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.role-info-mini { flex: 1; min-width: 0; }
.role-info-mini .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}
.role-info-mini .role {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0; /* flex 项默认 min-width:auto 会被看板等宽内容撑破页面；为 0 后 kanban 的 overflow-x:auto 才生效 */
    transition: var(--transition);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: rgba(255, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.menu-toggle:hover { background: var(--bg-soft); }

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--pku-red); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--pku-red);
    color: var(--pku-red);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--pku-red);
    color: var(--white);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
    background: var(--white);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-menu:hover { border-color: var(--pku-red); }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--pku-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Page Container */
.page-container {
    flex: 1;
    padding: 24px;
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-left h1 {
    margin-bottom: 6px;
}

.page-header-left p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-fast);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-body { padding: 20px; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-soft);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--pku-red);
    color: var(--white);
    border-color: var(--pku-red);
}

.btn-primary:hover:not(:disabled) {
    background: var(--pku-red-dark);
    border-color: var(--pku-red-dark);
    box-shadow: var(--shadow-red);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--pku-red);
    color: var(--pku-red);
    background: var(--pku-red-50);
}

.btn-ghost {
    background: transparent;
    color: var(--text-gray);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-soft);
    color: var(--pku-red);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) { background: #DC2626; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--pku-red);
    margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition-fast);
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--pku-red);
    box-shadow: 0 0 0 3px rgba(148, 7, 10, 0.08);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.7;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table th {
    font-weight: 600;
    color: var(--text-gray);
    background: var(--bg-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table tbody tr {
    transition: var(--transition-fast);
    cursor: pointer;
}

.data-table tbody tr:hover { background: var(--bg-soft); }

.data-table .col-title {
    white-space: normal;
    max-width: 300px;
}

/* Status badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-draft { background: var(--bg-light); color: var(--text-gray); }
.status-pending { background: var(--warning-light); color: #B45309; }
.status-review { background: var(--info-light); color: #1D4ED8; }
.status-approved { background: var(--success-light); color: #047857; }
.status-rejected { background: var(--danger-light); color: #B91C1C; }
.status-published { background: #E0E7FF; color: #4338CA; }
.status-risk { background: #FEF3C7; color: #92400E; }
.status-safe { background: #D1FAE5; color: #065F46; }

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--pku-red-50);
    color: var(--pku-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Content grids */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.content-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.content-grid.four-col { grid-template-columns: repeat(4, 1fr); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading state */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-top-color: var(--pku-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
    background: none; /* button 元素需重置 UA 默认样式，否则渲染成灰色按钮盒 */
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.tab:hover { color: var(--pku-red); }
.tab.active {
    color: var(--pku-red);
    border-bottom-color: var(--pku-red);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--pku-red);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 360px;
    animation: slideIn 0.3s ease;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-gray);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-close:hover { background: var(--bg-soft); color: var(--text-dark); }

.modal-close .ico,
.modal-close .ui-ico {
    width: 18px;
    height: 18px;
}

.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-soft);
    color: var(--text-gray);
}

.tag-platform {
    background: #E0E7FF;
    color: #4338CA;
}

/* Role selector */
.role-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.role-option {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--white);
}

.role-option:hover {
    border-color: var(--pku-red-light);
    background: var(--pku-red-50);
}

.role-option.active {
    border-color: var(--pku-red);
    background: var(--pku-red-50);
    box-shadow: var(--shadow-red);
}

.role-option .avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--pku-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 12px;
}

.role-option h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.role-option p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Platform selector */
.platform-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.platform-chip {
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.platform-chip:hover { border-color: var(--pku-red); color: var(--pku-red); }
.platform-chip.active {
    background: var(--pku-red);
    color: var(--white);
    border-color: var(--pku-red);
}

/* AI output cards */
.ai-output-card {
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.ai-output-card h5 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--pku-red);
}

.ai-output-card p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-dark);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 1px var(--border);
}

.timeline-item.active::before { background: var(--pku-red); }
.timeline-item.completed::before { background: var(--success); }

.timeline-item h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.timeline-item p {
    font-size: 0.85rem;
}

.timeline-item time {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Risk indicators */
.risk-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    margin-bottom: 12px;
}

.risk-score {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.risk-score.low { background: var(--success-light); color: #047857; }
.risk-score.medium { background: var(--warning-light); color: #B45309; }
.risk-score.high { background: var(--danger-light); color: #B91C1C; }

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container.sm { height: 220px; }
.chart-container.lg { height: 400px; }

/* Responsive */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid.four-col { grid-template-columns: repeat(2, 1fr); }
    .role-selector { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open { transform: translateX(0); }

    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }

    .topbar-left { flex: 1; min-width: 0; }
    .topbar-left > div { min-width: 0; }
    .topbar-right { flex-shrink: 0; }
    .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .breadcrumb { white-space: nowrap; overflow: hidden; }
    .breadcrumb > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .page-container { padding: 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --topbar-height: 56px; }

    .topbar { padding: 0 16px; }
    .page-container { padding: 16px; }

    .page-header {
        flex-direction: column;
        gap: 12px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .stats-grid { grid-template-columns: 1fr; }
    .content-grid { grid-template-columns: 1fr; }
    .content-grid.two-col,
    .content-grid.four-col { grid-template-columns: 1fr; }

    .user-name { display: none; }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .role-selector { grid-template-columns: 1fr; }

    .platform-selector {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .data-table th,
    .data-table td {
        padding: 12px;
    }

    .chart-container { height: 240px; }
    .chart-container.lg { height: 300px; }
}

/* ===== AI Chat Panel ===== */
.ai-panel {
    width: 360px;
    background: var(--white);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    position: sticky;
    top: var(--topbar-height);
    flex-shrink: 0;
}

.ai-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.ai-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-message {
    display: flex;
    gap: 10px;
    max-width: 92%;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.ai {
    align-self: flex-start;
}

.ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ai-message.ai .ai-avatar {
    background: var(--pku-red);
    color: var(--white);
}

.ai-message.user .ai-avatar {
    background: var(--bg-light);
}

.ai-bubble {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-message.ai .ai-bubble {
    background: var(--bg-soft);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

.ai-message.user .ai-bubble {
    background: var(--pku-red);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.ai-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ai-actions .btn {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.ai-context-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--pku-red-50);
    color: var(--pku-red);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

.ai-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-soft);
}

.ai-quick-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ai-quick-actions .btn {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.ai-input-wrap {
    display: flex;
    gap: 8px;
}

.ai-input-wrap .form-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.9rem;
}

/* ===== Editor Enhanced ===== */
.editor-workspace {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--topbar-height) - 140px);
    gap: 20px;
}

.editor-main {
    flex: 1;
    min-width: 0;
}

/* 稿件信息卡元数据：标签弱化小字，层级低于值 */
.meta-item h4 { font-size: 0.8rem; color: var(--text-light); font-weight: 600; margin-bottom: 4px; }
.meta-item p { font-size: 0.88rem; color: var(--text-dark); }

.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    flex-wrap: wrap;
    border: 1px solid var(--border-light);
}

.toolbar-group {
    display: flex;
    gap: 2px;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px solid var(--border-light);
}

.toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.toolbar-btn {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    color: var(--text-dark);
}

.toolbar-btn:hover {
    background: var(--white);
    border-color: var(--border);
}

.toolbar-btn.active {
    background: var(--pku-red-50);
    color: var(--pku-red);
}

.toolbar-btn.wide {
    width: auto;
    padding: 0 10px;
    gap: 4px;
    font-size: 0.8rem;
}

.editor-area {
    min-height: 420px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 1.05rem;
    line-height: 1.8;
    outline: none;
}

.editor-area:focus {
    border-color: var(--pku-red);
    box-shadow: 0 0 0 3px rgba(148, 7, 10, 0.06);
}

.editor-area h2 {
    font-size: 1.5rem;
    margin: 24px 0 12px;
}

.editor-area p {
    margin-bottom: 12px;
}

.editor-area blockquote {
    border-left: 3px solid var(--pku-red);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-gray);
    font-style: italic;
}

.editor-area ul, .editor-area ol {
    margin: 12px 0 12px 24px;
}

.editor-area img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.editor-meta-panel {
    width: 280px;
    flex-shrink: 0;
}

.editor-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 8px;
}

/* ===== Assets Library Enhanced ===== */
.assets-workspace {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 220px);
}

.assets-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.folder-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-gray);
    transition: var(--transition-fast);
}

.folder-item:hover {
    background: var(--bg-soft);
    color: var(--pku-red);
}

.folder-item.active {
    background: var(--pku-red-50);
    color: var(--pku-red);
    font-weight: 600;
}

.folder-item .icon {
    font-size: 1rem;
}

.folder-item .count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 50px;
}

.assets-main {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 20px;
}

.assets-grid-area {
    flex: 1;
    min-width: 0;
}

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.asset-list-item:hover,
.asset-list-item.active {
    border-color: var(--pku-red);
    background: var(--pku-red-50);
}

.asset-list-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.asset-list-info {
    flex: 1;
    min-width: 0;
}

.asset-list-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-list-info p {
    font-size: 0.75rem;
    color: var(--text-light);
}

.asset-detail-panel {
    width: 280px;
    flex-shrink: 0;
}

.asset-detail-preview {
    height: 160px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ===== Knowledge Base ===== */
.knowledge-workspace {
    display: flex;
    gap: 20px;
}

.knowledge-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.knowledge-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 2px;
    transition: var(--transition-fast);
}

.knowledge-cat:hover {
    background: var(--bg-soft);
    color: var(--pku-red);
}

.knowledge-cat.active {
    background: var(--pku-red);
    color: var(--white);
}

.knowledge-main {
    flex: 1;
    min-width: 0;
}

.knowledge-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.knowledge-card:hover {
    border-color: var(--pku-red);
    background: var(--pku-red-50);
}

.knowledge-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.knowledge-card-icon .ico,
.knowledge-card-icon .ui-ico,
.asset-list-thumb .ico,
.asset-list-thumb .ui-ico,
.asset-thumb .ico,
.asset-thumb .ui-ico {
    width: 26px;
    height: 26px;
}

.asset-list-info .ico,
.asset-list-info .ui-ico {
    width: 1em;
    height: 1em;
}

.asset-detail-preview .ico,
.asset-detail-preview .ui-ico {
    width: 62px;
    height: 62px;
}

.knowledge-card-body {
    flex: 1;
    min-width: 0;
}

.knowledge-card-body h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.knowledge-card-body p {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.knowledge-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ===== Responsive additions ===== */
@media (max-width: 1280px) {
    .editor-workspace,
    .assets-workspace,
    .assets-main,
    .knowledge-workspace {
        flex-direction: column;
    }

    .ai-panel,
    .editor-meta-panel,
    .assets-sidebar,
    .asset-detail-panel,
    .knowledge-sidebar {
        width: 100%;
    }

    .ai-panel {
        height: auto;
        max-height: 500px;
        border-left: none;
        border-top: 1px solid var(--border-light);
    }
}

@media (max-width: 768px) {
    .editor-workspace,
    .assets-main,
    .knowledge-workspace {
        flex-direction: column;
    }

    .assets-sidebar,
    .asset-detail-panel,
    .knowledge-sidebar {
        width: 100%;
    }
}

/* ===== Notification Center ===== */
.notification-center {
    position: relative;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notification-panel.active { display: flex; }

.notification-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-left: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    transform: rotate(45deg);
}

.notification-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-header h4 {
    font-size: 0.95rem;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

.notification-item:hover { background: var(--bg-soft); }
.notification-item.unread { background: var(--pku-red-50); }
.notification-item.unread:hover { background: #FCE8E8; }

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--bg-soft);
}

.notification-item.unread .notification-icon { background: var(--white); }

.notification-body { flex: 1; min-width: 0; }
.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}
.notification-text {
    font-size: 0.8rem;
    color: var(--text-gray);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notification-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.notification-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-soft);
    text-align: center;
}

.notification-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .notification-panel {
        width: calc(100vw - 32px);
        right: -12px;
    }
}

/* ===== AI Human-in-the-loop Footer ===== */
.ai-human-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--pku-red-50);
    border: 1px solid rgba(148, 7, 10, 0.12);
    border-radius: var(--radius-lg);
    margin-top: 24px;
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-human-hint .hint-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pku-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ai-human-hint strong {
    color: var(--pku-red);
    display: block;
    margin-bottom: 2px;
}

/* ===== Process Tracking Page ===== */
.tracking-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}

.tracking-filters .form-group {
    margin-bottom: 0;
    min-width: 160px;
    flex: 1;
}

.tracking-filters .form-group.search {
    flex: 2;
    min-width: 240px;
}

.view-switcher {
    display: flex;
    gap: 6px;
    background: var(--bg-soft);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.view-switcher button {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.view-switcher button.active {
    background: var(--white);
    color: var(--pku-red);
    box-shadow: var(--shadow-sm);
}

/* Kanban Board：列数多/屏幕窄时自动折行，不再横向裁切 */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding-bottom: 8px;
    min-height: 500px;
}

.kanban-column {
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-header h4 {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-count {
    background: var(--white);
    color: var(--text-gray);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    border: 1px solid var(--border-light);
}

.kanban-column-body {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 600px;
}

.kanban-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.kanban-card:hover {
    border-color: var(--pku-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kanban-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.kanban-card-meta .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card-platforms {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.kanban-card-due {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card-due.overdue {
    color: var(--danger);
    font-weight: 600;
}

.kanban-card-due.soon {
    color: var(--warning);
    font-weight: 600;
}

.kanban-card-owner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.owner-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--pku-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Timeline View */
.tracking-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 180px 1fr 200px;
    gap: 20px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.timeline-item-card:hover {
    border-color: var(--pku-red);
}

.timeline-item-stage {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pku-red);
}

.timeline-item-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.timeline-item-info {
    font-size: 0.85rem;
    color: var(--text-gray);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.timeline-item-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-item-progress .bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.timeline-item-progress .bar > div {
    height: 100%;
    background: var(--pku-red);
    border-radius: 4px;
}

.timeline-item-progress .label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: right;
}

/* Tracking List View */
.tracking-list .data-table td {
    vertical-align: middle;
}

.tracking-list .stage-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tracking-list .stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pku-red);
}

.tracking-list .platform-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Tracking Stats */
.tracking-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.tracking-stat {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.tracking-stat .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.tracking-stat .label {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.tracking-stat .change {
    font-size: 0.75rem;
    margin-top: 6px;
    font-weight: 600;
}

/* Audit Trail in Modal */
.audit-trail {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.audit-trail-item {
    display: flex;
    gap: 14px;
    position: relative;
    padding-left: 28px;
}

.audit-trail-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 28px;
    bottom: -20px;
    width: 2px;
    background: var(--border-light);
}

.audit-trail-item:last-child::before { display: none; }

.audit-trail-dot {
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pku-red);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 1px var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--white);
}

.audit-trail-item.completed .audit-trail-dot { background: var(--success); }
.audit-trail-item.active .audit-trail-dot { background: var(--pku-red); }
.audit-trail-item.pending .audit-trail-dot { background: var(--border); color: var(--text-light); }

.audit-trail-content {
    flex: 1;
    padding-bottom: 8px;
}

.audit-trail-content h5 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.audit-trail-content p {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.audit-trail-content time {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Responsive tracking */
@media (max-width: 1280px) {
    .kanban-board { grid-template-columns: repeat(4, 1fr); }
    .tracking-stats { grid-template-columns: repeat(2, 1fr); }
    .timeline-item-card { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }
    .kanban-column { min-width: auto; }
    .tracking-stats { grid-template-columns: 1fr; }
    .tracking-filters .form-group { min-width: 100%; }
}

/* Print */
@media print {
    .sidebar, .topbar { display: none; }
    .main-content { margin-left: 0; }
}

/* ===== Iteration v2: 选题策划 / 平台发布卡片 / 内容池 / 热点分级 ===== */

/* Campaign Brief(选题策划) */
.brief-section { border: 1px solid var(--border-light); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.brief-section-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-soft); font-weight: 600; }
.brief-section-body { padding: 14px 16px; }
.brief-field { margin-bottom: 12px; }
.brief-field-label { font-size: 0.8rem; color: var(--text-gray); margin-bottom: 4px; font-weight: 600; }
.brief-field-content { line-height: 1.6; }
.brief-field-content[contenteditable="true"] { outline: none; border-radius: 6px; }
.brief-field-content[contenteditable="true"]:focus { background: var(--pku-red-50); box-shadow: 0 0 0 1px var(--pku-red-light); }

/* 平台发布卡片 */
.publish-card-item { border: 1px solid var(--border-light); border-radius: 10px; padding: 16px; margin-bottom: 14px; background: var(--white); }
.publish-card-item.confirmed { border-color: var(--success); background: #F0FDF6; }
.publish-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.publish-card-platform { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.publish-card-field { margin-bottom: 10px; font-size: 0.9rem; }
.publish-card-field .field-label { font-size: 0.78rem; color: var(--text-gray); font-weight: 600; margin-bottom: 3px; }
.publish-card-field .field-body { line-height: 1.55; }
.time-hint { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.time-hint.red { background: var(--danger-light); color: var(--danger); }
.time-hint.green { background: var(--success-light); color: var(--success); }
.ai-publish-tips { background: var(--bg-soft); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; color: var(--text-gray); }
.ai-publish-tips li { margin-bottom: 4px; }

/* 内容池 */
.pool-card { border: 1px solid var(--border-light); border-radius: 10px; padding: 16px; background: var(--white); display: flex; flex-direction: column; gap: 8px; }
.pool-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pool-card-title { font-weight: 700; line-height: 1.4; }
.pool-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-ddl { font-size: 0.8rem; font-weight: 600; }
.pool-ddl.urgent { color: var(--danger); }
.pool-ddl.normal { color: var(--success); }

/* 热点四级分区 */
.trend-category { margin-bottom: 18px; }
.trend-category-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.trend-category-title .cat-count { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }
.trend-category.risk .trend-category-title { color: var(--danger); }

/* 对比看板(北大 vs 清华) */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.compare-table th, .compare-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border-light); }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; color: var(--text-gray); }
.compare-table thead th { font-size: 0.8rem; color: var(--text-gray); font-weight: 600; }
.compare-delta-up { color: var(--success); font-size: 0.78rem; }
.compare-delta-down { color: var(--danger); font-size: 0.78rem; }

/* Metrics Overview 综合看板 */
.metrics-overview { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.metrics-overview th, .metrics-overview td { padding: 7px 9px; text-align: right; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.metrics-overview th:first-child, .metrics-overview td:first-child { text-align: left; font-weight: 600; }
.metrics-overview thead th { color: var(--text-gray); font-size: 0.76rem; font-weight: 600; }

/* ===== 交付边界标注（Iteration v3：原型功能边界说明，hover 显示 tooltip；纯展示，不影响交互） ===== */
.impl-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    margin-left: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.7;
    white-space: nowrap;
    border: 1px solid;
    cursor: help;
    user-select: none;
    vertical-align: middle;
}
.impl-badge--demo { color: var(--danger); border-color: var(--danger); background: var(--danger-light); }
.impl-badge--cond { color: var(--warning-dark); border-color: var(--warning); background: var(--warning-light); }
.impl-badge--info { color: var(--info); border-color: var(--info); background: var(--info-light); }
.impl-badge--plan { color: var(--text-gray); border-color: var(--border); background: #F5F2EE; }

/* 标注提示浮层（app.js fixed 定位渲染，脱离 overflow 容器裁剪；index.html 自包含页仍用 ::after 方案） */
.impl-tip {
    position: fixed;
    max-width: 260px;
    background: var(--text-dark);
    color: #fff;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.55;
    box-shadow: var(--shadow-md);
    z-index: 10000;
    pointer-events: none;
}

/* 全局隐藏开关（顶栏「标注」按钮切换；图例里的样例胶囊不受隐藏影响） */
body.hide-impl-badges .impl-badge:not(.impl-legend-chip) { display: none !important; }

/* 顶栏标注图例弹层 */
.impl-legend {
    position: fixed;
    top: calc(var(--topbar-height) + 4px);
    right: 24px;
    width: 320px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    z-index: 3000;
    font-size: 0.82rem;
    color: var(--text-gray);
    line-height: 1.6;
}
.impl-legend h4 { margin: 0 0 6px; font-size: 0.9rem; color: var(--text-dark); }
.impl-legend ul { margin: 8px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.impl-legend li { display: flex; align-items: flex-start; gap: 8px; }
.impl-legend .impl-badge { flex-shrink: 0; margin-left: 0; }
.impl-legend .impl-legend-toggle {
    width: 100%;
    margin-top: 10px;
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 0.82rem;
    cursor: pointer;
}
.impl-legend .impl-legend-toggle:hover { background: #F5F2EE; }
