/* ==========================================
   Design Tokens — Light / Dark dual-track
   ========================================== */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color-scheme: light dark;

    /* Brand */
    --brand-50:  #f0f5ff;
    --brand-100: #d4e3fc;
    --brand-200: #a3c4f9;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;

    /* Semantic */
    --red-50:    #fef2f2; --red-500:    #ef4444; --red-600: #dc2626;
    --amber-50:  #fffbeb; --amber-500:  #f59e0b;
    --green-50:  #ecfdf5; --green-500:  #10b981;
    --purple-50: #faf5ff; --purple-500: #8b5cf6;
    --blue-50:   #eff6ff;

    /* Neutral (light) */
    --gray-50:  #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
    --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280;
    --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937;
    --gray-900: #111827;

    /* Surfaces */
    --bg-page:     #f0f2f5;
    --bg-card:     rgba(255, 255, 255, 0.78);
    --bg-elevated: rgba(255, 255, 255, 0.92);
    --bg-input:    #ffffff;
    --bg-overlay:  rgba(0, 0, 0, 0.45);
    --border:      rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.1);

    /* Text */
    --text-1: var(--gray-900);
    --text-2: var(--gray-600);
    --text-3: var(--gray-500);
    --text-4: var(--gray-400);

    /* Radii */
    --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.15s; --dur-norm: 0.25s; --dur-slow: 0.4s;
}

/* ── Dark Mode ─────────────────────────────── */
[data-theme="dark"] {
    --bg-page:     #0c0d12;
    --bg-card:     rgba(22, 25, 35, 0.82);
    --bg-elevated: rgba(30, 34, 48, 0.9);
    --bg-input:    #1a1d28;
    --bg-overlay:  rgba(0, 0, 0, 0.7);
    --border:      rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.1);

    --gray-50:  #14161e; --gray-100: #1a1d28; --gray-200: #252a38;
    --gray-300: #363d50; --gray-400: #5c6478; --gray-500: #8b90a0;
    --gray-600: #a8acba; --gray-700: #c5c8d4; --gray-800: #dfe1e8;
    --gray-900: #eceef2;

    --text-1: #eceef2;
    --text-2: #a8acba;
    --text-3: #8b90a0;
    --text-4: #5c6478;

    --brand-50: rgba(59, 130, 246, 0.1);
    --blue-50:  rgba(59, 130, 246, 0.08);
    --red-50:   rgba(239, 68, 68, 0.1);
    --amber-50: rgba(245, 158, 11, 0.1);
    --green-50: rgba(16, 185, 129, 0.1);
    --purple-50:rgba(139, 92, 246, 0.1);
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text-1);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background var(--dur-norm) var(--ease), color var(--dur-norm) var(--ease);
}

/* 页面级微弱背景光晕 (已移除) */
body::before {
    display: none;
}
[data-theme="dark"] body::before {
    display: none;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle; line-height: 1;
}

/* ── Layout ────────────────────────────────── */
.shell { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ── TopBar ────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg-elevated);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--dur-norm) var(--ease);
}
.topbar-inner {
    max-width: 1040px; margin: 0 auto; padding: 0 20px;
    height: 56px; display: flex; align-items: center; gap: 16px;
}
.topbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 17px; color: var(--text-1);
    text-decoration: none; letter-spacing: -0.3px; flex-shrink: 0;
}
.brand-icon {
    width: 30px; height: 30px;
    background: var(--brand-600);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.brand-icon .material-symbols-outlined { font-size: 18px; font-variation-settings: 'FILL' 1; }

/* Search bar in topbar */
.topbar-search {
    flex: 1; max-width: 380px; position: relative;
}
.topbar-search .material-symbols-outlined {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 18px; color: var(--text-4); pointer-events: none;
}
.topbar-search input {
    width: 100%; padding: 8px 14px 8px 38px;
    border: 1.5px solid var(--border-strong); border-radius: var(--r-full);
    font-size: 13px; font-family: inherit; color: var(--text-1);
    background: var(--bg-input); outline: none;
    transition: all var(--dur-fast) var(--ease);
}
.topbar-search input::placeholder { color: var(--text-4); }
.topbar-search input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.topbar-actions {
    display: flex; align-items: center; gap: 4px; margin-left: auto;
}
.topbar-actions a, .topbar-actions button {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 500; color: var(--text-2);
    text-decoration: none; cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
    background: transparent; border: none; font-family: inherit;
}
.topbar-actions .material-symbols-outlined { font-size: 18px; }
.topbar-actions a:hover, .topbar-actions button:hover {
    background: var(--gray-100); color: var(--text-1);
}
.topbar-actions a.active { background: var(--brand-50); color: var(--brand-600); }

.theme-toggle {
    width: 36px; height: 36px; padding: 0 !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    border-radius: 50% !important;
}

/* ── Views ─────────────────────────────────── */
.view { display: none; padding: 28px 0 60px; animation: viewIn var(--dur-norm) var(--ease); }
.view.active { display: block; }
@keyframes viewIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--text-1); letter-spacing: -0.3px; }

/* ── Stat Cards ────────────────────────────── */
.stat-bar {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 16px 18px; box-shadow: var(--shadow-xs);
    transition: all var(--dur-norm) var(--ease);
    display: flex; align-items: center; gap: 14px;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat-icon {
    width: 40px; height: 40px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon .material-symbols-outlined { font-size: 22px; }
.si-total { background: var(--gray-100); color: var(--gray-500); }
.si-open  { background: var(--red-50);   color: var(--red-500); }
.si-prog  { background: var(--blue-50);  color: var(--brand-600); }
.si-done  { background: var(--green-50); color: var(--green-500); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.stat-label {
    font-size: 12px; color: var(--text-4); margin-top: 2px;
    font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-card.st-open .stat-num   { color: var(--red-500); }
.stat-card.st-prog .stat-num   { color: var(--brand-600); }
.stat-card.st-done .stat-num   { color: var(--green-500); }

/* ── Toolbar (Board tabs + filters) ────────── */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.board-tabs {
    display: flex; gap: 6px; overflow-x: auto; padding: 3px;
    flex-shrink: 0;
}
.board-tab {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 14px; border-radius: var(--r-full);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: 1.5px solid var(--border-strong); background: transparent;
    color: var(--text-3); white-space: nowrap; font-family: inherit;
    transition: all var(--dur-fast) var(--ease);
}
.board-tab .material-symbols-outlined { font-size: 15px; }
.board-tab:hover { border-color: var(--gray-400); color: var(--text-2); }
.board-tab.active {
    background: var(--brand-500); color: #fff;
    border-color: var(--brand-500); box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.filter-bar {
    display: flex; gap: 6px; padding: 3px;
    background: var(--gray-100); border-radius: var(--r-md); width: fit-content;
}
.filter-tab {
    padding: 5px 14px; border-radius: var(--r-sm);
    font-size: 12.5px; font-weight: 500; color: var(--text-3);
    cursor: pointer; border: none; background: transparent; font-family: inherit;
    transition: all var(--dur-fast) var(--ease);
}
.filter-tab:hover { color: var(--text-2); }
.filter-tab.active {
    background: var(--bg-input); color: var(--text-1); box-shadow: var(--shadow-xs);
}

.toolbar-right {
    display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.toolbar-select {
    padding: 5px 10px; border: 1.5px solid var(--border-strong);
    border-radius: var(--r-sm); font-size: 12.5px; font-family: inherit;
    background: var(--bg-input); color: var(--text-2); outline: none; cursor: pointer;
}

/* ── Issue Cards ───────────────────────────── */
.issue-list { display: flex; flex-direction: column; gap: 8px; }
.issue-card {
    background: var(--bg-card); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 16px 20px; cursor: pointer;
    transition: all var(--dur-norm) var(--ease);
    position: relative; overflow: hidden;
}
.issue-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: 0 2px 2px 0;
}
.card-open::before      { background: var(--red-500); }
.card-inprogress::before { background: var(--brand-500); }
.card-closed::before    { background: var(--green-500); }
.card-cancelled::before { background: var(--gray-300); }
.issue-card:hover {
    box-shadow: var(--shadow-md); transform: translateY(-2px);
    border-color: var(--border-strong);
}
.issue-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.issue-id {
    font-size: 13px; font-weight: 600; color: var(--text-4);
    margin-right: 6px; font-variant-numeric: tabular-nums;
}
.issue-title { font-size: 15px; font-weight: 600; color: var(--text-1); line-height: 1.4; }
.issue-bottom {
    display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}

/* ── Badges ────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: var(--r-full);
    font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
    white-space: nowrap; flex-shrink: 0;
}
.badge .material-symbols-outlined { font-size: 13px; }
.badge-open       { background: var(--red-50);    color: var(--red-500); }
.badge-inprogress { background: var(--blue-50);   color: var(--brand-600); }
.badge-closed     { background: var(--green-50);  color: var(--green-500); }
.badge-cancelled  { background: var(--gray-100);  color: var(--gray-400); }

/* Priority badges */
.badge-critical { background: var(--red-50);    color: var(--red-600); }
.badge-high     { background: var(--amber-50);  color: var(--amber-500); }
.badge-medium   { background: var(--blue-50);   color: var(--brand-500); }
.badge-low      { background: var(--gray-100);  color: var(--gray-500); }

/* Priority dot with pulse animation for Critical */
.priority-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.priority-dot.p-critical { background: var(--red-500); }
.priority-dot.p-high     { background: var(--amber-500); }
.priority-dot.p-medium   { background: var(--brand-500); }
.priority-dot.p-low      { background: var(--gray-400); }

/* Tags */
.tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: var(--r-full);
    font-size: 11px; font-weight: 500;
    border: 1px solid; white-space: nowrap;
}
.tag .tag-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Board indicator pill */
.board-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--r-full);
    font-size: 11px; font-weight: 500; white-space: nowrap;
}
.board-pill .material-symbols-outlined { font-size: 12px; }

.meta-text { font-size: 12px; color: var(--text-4); font-weight: 400; }
.meta-text .dot { margin: 0 5px; }
.comment-count {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11.5px; color: var(--text-4); font-weight: 500;
}
.comment-count .material-symbols-outlined { font-size: 14px; }

/* ── Empty State ───────────────────────────── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-4); }
.empty-state .empty-icon { margin-bottom: 16px; }
.empty-state .empty-icon .material-symbols-outlined { font-size: 56px; color: var(--gray-300); }
.empty-state p { font-size: 14px; font-weight: 500; margin-bottom: 20px; }

/* ── Pagination ────────────────────────────── */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 4px; margin-top: 24px;
}
.pagination button {
    min-width: 36px; height: 36px; padding: 0 8px;
    border: 1px solid var(--border-strong); border-radius: var(--r-sm);
    background: var(--bg-card); color: var(--text-2);
    font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
    transition: all var(--dur-fast) var(--ease);
}
.pagination button:hover { background: var(--gray-100); color: var(--text-1); }
.pagination button.active {
    background: var(--brand-500); color: #fff;
    border-color: var(--brand-500);
}
.pagination button:disabled {
    opacity: 0.4; cursor: not-allowed;
}

/* ── Buttons ───────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 9px 20px; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    border: none; font-family: inherit;
    transition: all var(--dur-fast) var(--ease); line-height: 1.4;
}
.btn .material-symbols-outlined { font-size: 18px; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--brand-600);
    color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(37,99,235,0.35); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-100); color: var(--text-1); }

.btn-outline { background: transparent; color: var(--text-2); border: 1px solid var(--border-strong); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-danger { background: transparent; color: var(--red-500); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: var(--red-50); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-sm .material-symbols-outlined { font-size: 16px; }
.btn-block { width: 100%; }

/* ── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 13px; font-weight: 600; color: var(--text-2);
}
.form-label .optional { font-weight: 400; color: var(--text-4); margin-left: 4px; font-size: 12px; }

.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border-strong); border-radius: var(--r-sm);
    font-size: 14px; font-family: inherit; color: var(--text-1);
    background: var(--bg-input); outline: none;
    transition: all var(--dur-fast) var(--ease);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--gray-300); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Tag selection chips */
.tag-selector {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: var(--r-full);
    font-size: 12px; font-weight: 500; cursor: pointer;
    border: 1.5px solid var(--border-strong); background: transparent;
    color: var(--text-3); font-family: inherit;
    transition: all var(--dur-fast) var(--ease);
}
.tag-chip .tag-dot { width: 6px; height: 6px; border-radius: 50%; }
.tag-chip.selected {
    border-color: currentColor; font-weight: 600;
}
.tag-chip:hover { border-color: var(--gray-400); }

/* Upload zone */
.upload-zone {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border: 1.5px dashed var(--border-strong);
    border-radius: var(--r-sm); background: var(--gray-50);
    transition: all var(--dur-fast); cursor: pointer;
}
.upload-zone:hover { border-color: var(--brand-500); background: var(--brand-50); }
.upload-zone input[type="file"] { display: none; }
.upload-icon {
    width: 40px; height: 40px; border-radius: var(--r-sm);
    background: var(--brand-50); display: flex; align-items: center; justify-content: center;
    color: var(--brand-500); flex-shrink: 0;
}
.upload-icon .material-symbols-outlined { font-size: 22px; }
.upload-text { font-size: 13px; color: var(--text-3); }
.upload-text strong { color: var(--brand-600); }

.upload-status { margin-top: 8px; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.upload-status .material-symbols-outlined { font-size: 16px; }
.upload-status.success { color: var(--green-500); }
.upload-status.error   { color: var(--red-500); }
.upload-status.loading { color: var(--brand-500); }

/* ── Modal ─────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: none; align-items: center; justify-content: center;
    background: var(--bg-overlay); backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; animation: overlayIn var(--dur-norm) var(--ease); }
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }
.modal-dialog {
    background: var(--bg-elevated); border-radius: var(--r-lg);
    width: 420px; max-width: 92vw; padding: 32px;
    box-shadow: var(--shadow-xl);
    animation: dialogIn var(--dur-slow) var(--ease);
}
[data-theme="dark"] .modal-dialog { background: #1e2230; }
@keyframes dialogIn { from { opacity:0; transform:translateY(24px) scale(0.96); } to { opacity:1; transform:translateY(0) scale(1); } }
.modal-title {
    font-size: 18px; font-weight: 700; color: var(--text-1);
    margin-bottom: 24px; display: flex; align-items: center; gap: 8px;
}
.modal-title .material-symbols-outlined { font-size: 22px; color: var(--brand-500); }

/* ── Detail View ───────────────────────────── */
.detail-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 20px;
}
.detail-title { font-size: 24px; font-weight: 700; color: var(--text-1); letter-spacing: -0.3px; line-height: 1.3; }
.detail-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}

/* Markdown rendered content */
.detail-body {
    font-size: 14.5px; line-height: 1.8; color: var(--text-2);
    word-break: break-word;
}
.detail-body p { margin-bottom: 12px; }
.detail-body h1, .detail-body h2, .detail-body h3 { color: var(--text-1); margin: 20px 0 12px; }
.detail-body code {
    background: var(--gray-100); padding: 2px 6px;
    border-radius: 4px; font-size: 13px;
}
.detail-body pre {
    background: var(--gray-100); border-radius: var(--r-sm);
    padding: 16px; overflow-x: auto; margin: 16px 0;
}
.detail-body pre code { background: transparent; padding: 0; }
.detail-body img {
    max-width: 100%; border-radius: var(--r-md);
    margin: 16px 0; box-shadow: var(--shadow-sm);
}
.detail-body blockquote {
    border-left: 3px solid var(--brand-500); padding-left: 16px;
    color: var(--text-3); margin: 16px 0;
}
.detail-body ul, .detail-body ol { padding-left: 24px; margin-bottom: 12px; }

/* Admin control bar */
.admin-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 14px 18px; background: var(--gray-50); border-radius: var(--r-md);
    border: 1px solid var(--border); margin-bottom: 24px;
}
[data-theme="dark"] .admin-bar { background: var(--gray-100); }
.admin-bar-label {
    font-size: 13px; font-weight: 600; color: var(--text-2);
    display: flex; align-items: center; gap: 4px;
}
.admin-bar-label .material-symbols-outlined { font-size: 18px; }
.admin-bar .form-select { width: auto; padding: 7px 12px; font-size: 13px; }

/* ── Comments Timeline ─────────────────────── */
.comments-section { margin-top: 32px; }
.comments-title {
    font-size: 16px; font-weight: 700; color: var(--text-1);
    display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
}
.comments-title .material-symbols-outlined { font-size: 20px; color: var(--brand-500); }

.comment-timeline { position: relative; }
.comment-item {
    display: flex; gap: 12px; position: relative; padding-bottom: 20px;
}
/* 连接线 */
.comment-item:not(:last-child)::before {
    content: ''; position: absolute; left: 16px; top: 36px; bottom: 0;
    width: 2px; background: var(--border);
}
.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; position: relative; z-index: 1;
}
.comment-avatar.human {
    background: var(--brand-100);
    color: var(--brand-700);
}
.comment-avatar.system {
    background: var(--gray-100); color: var(--gray-500);
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.comment-author { font-size: 13px; font-weight: 600; color: var(--text-1); }
.comment-time   { font-size: 11.5px; color: var(--text-4); }
.comment-team-badge {
    font-size: 10px; font-weight: 600; padding: 1px 6px;
    border-radius: var(--r-full); background: var(--brand-50); color: var(--brand-600);
}
.comment-content {
    font-size: 13.5px; line-height: 1.7; color: var(--text-2);
}
.comment-content.system-msg {
    font-style: italic; color: var(--text-3); font-size: 12.5px;
}
/* Markdown in comments */
.comment-content p { margin-bottom: 8px; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-content code { background: var(--gray-100); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.comment-content pre { background: var(--gray-100); padding: 12px; border-radius: var(--r-sm); overflow-x: auto; margin: 8px 0; }

/* Comment input */
.comment-form {
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-md); margin-top: 4px;
}
.comment-form textarea {
    width: 100%; min-height: 80px; padding: 10px 14px;
    border: 1.5px solid var(--border-strong); border-radius: var(--r-sm);
    font-size: 13.5px; font-family: inherit; color: var(--text-1);
    background: var(--bg-input); outline: none; resize: vertical; line-height: 1.6;
}
.comment-form textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.comment-form-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ── Panel View ────────────────────────────── */
.panel-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.panel-tab {
    padding: 8px 16px; font-size: 13.5px; font-weight: 500;
    color: var(--text-3); cursor: pointer; border: none; background: transparent;
    font-family: inherit; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all var(--dur-fast) var(--ease);
    display: inline-flex; align-items: center; gap: 5px;
}
.panel-tab .material-symbols-outlined { font-size: 18px; }
.panel-tab:hover { color: var(--text-1); }
.panel-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }

.panel-pane { display: none; animation: viewIn var(--dur-norm) var(--ease); }
.panel-pane.active { display: block; }

.panel-section {
    background: var(--bg-card); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 24px; margin-bottom: 20px;
}
.panel-section h3 {
    font-size: 15px; font-weight: 700; color: var(--text-1);
    margin-bottom: 18px; display: flex; align-items: center; gap: 6px;
}
.panel-section h3 .material-symbols-outlined { font-size: 20px; color: var(--brand-500); }

.team-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }
.team-user { display: flex; align-items: center; gap: 10px; }
.team-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand-100);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--brand-700);
}
.team-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.team-role { font-size: 12px; color: var(--text-4); }

/* Management item rows (boards, tags) */
.manage-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.manage-row:last-child { border-bottom: none; }
.manage-info { display: flex; align-items: center; gap: 10px; }
.manage-color {
    width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
    border: 1px solid var(--border);
}
.manage-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.manage-desc { font-size: 12px; color: var(--text-4); }

/* ── Toast ─────────────────────────────────── */
.toast-container {
    position: fixed; top: 68px; right: 20px; z-index: 300;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: var(--r-sm);
    background: var(--gray-900); color: #fff;
    font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 8px;
    animation: toastIn var(--dur-norm) var(--ease), toastOut 0.3s ease forwards;
    animation-delay: 0s, 2.5s; pointer-events: none;
}
.toast .material-symbols-outlined { font-size: 18px; }
.toast-success { background: var(--green-500); }
.toast-error   { background: var(--red-500); }
@keyframes toastIn  { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-10px); } }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
    .stat-bar { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .topbar-brand span { display: none; }
    .topbar-search { max-width: 200px; }
    .detail-header { flex-direction: column; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-right { margin-left: 0; }
    .board-tabs { width: 100%; }
    .filter-bar { width: 100%; overflow-x: auto; }
    .admin-bar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
    .topbar-search { display: none; }
    .stat-bar { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px 14px; }
}
