/* ══════════════════════════════════════════
   需求工作台 — Notion-style Design System
   ══════════════════════════════════════════ */

:root {
    --bg: #ffffff;
    --bg-sidebar: #f7f7f5;
    --bg-hover: rgba(55, 53, 47, 0.04);
    --bg-card-hover: rgba(55, 53, 47, 0.02);

    --text: #37352f;
    --text-secondary: rgba(55, 53, 47, 0.65);
    --text-tertiary: rgba(55, 53, 47, 0.45);

    --border: rgba(55, 53, 47, 0.09);
    --border-strong: rgba(55, 53, 47, 0.16);

    /* Status colors — small badge only, does not break B&W main tone */
    --ok-bg: #e8f5e9;
    --ok-text: #2e7d32;
    --progress-bg: #e3f2fd;
    --progress-text: #1565c0;
    --todo-bg: #fff3e0;
    --todo-text: #e65100;
    --blocked-bg: #fce4ec;
    --blocked-text: #c62828;

    --radius-card: 8px;
    --radius-badge: 4px;
    --radius-sm: 6px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --transition: 0.15s ease;
}

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

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}


/* ══════════════════════════════
   Layout
   ══════════════════════════════ */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    cursor: default;
}

.sidebar-brand .brand-icon {
    font-size: 18px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 0 8px;
    margin: 16px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    margin-bottom: 1px;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--bg-hover);
    color: var(--text);
    font-weight: 500;
}

.sidebar-link .link-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
}


/* ── Main Content ── */
.main {
    flex: 1;
    min-width: 0;
    padding: 48px 64px 80px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}


/* ══════════════════════════════
   Typography
   ══════════════════════════════ */

.page-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title .title-icon {
    font-size: 40px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text);
}


/* ══════════════════════════════
   Breadcrumb
   ══════════════════════════════ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition);
}

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

.breadcrumb-sep {
    font-size: 11px;
}


/* ══════════════════════════════
   Status Badges
   ══════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-badge);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.5;
}

.status-ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.status-in-progress {
    background: var(--progress-bg);
    color: var(--progress-text);
}

.status-todo {
    background: var(--todo-bg);
    color: var(--todo-text);
}

.status-blocked {
    background: var(--blocked-bg);
    color: var(--blocked-text);
}

.priority-badge {
    background: var(--bg-sidebar);
    color: var(--text);
    border: 1px solid var(--border-strong);
}


/* ══════════════════════════════
   Stat Cards (Overview Bar)
   ══════════════════════════════ */

.stat-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    background: var(--bg);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}


/* ══════════════════════════════
   Project Card (Homepage)
   ══════════════════════════════ */

.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.project-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    background: var(--bg);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.project-card-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.project-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.project-card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-card-meta .meta-label {
    color: var(--text-tertiary);
}

.project-card-progress {
    margin-top: 12px;
}

.progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-sidebar);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}


/* ══════════════════════════════
   Meta Profile Card (Detail)
   ══════════════════════════════ */

.meta-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--bg);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-item .meta-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.meta-item .meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}


/* ══════════════════════════════
   Gate Cards (Detail Tracking)
   ══════════════════════════════ */

.gate-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.gate-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    background: var(--bg);
    transition: background var(--transition), box-shadow var(--transition);
}

.gate-card:hover {
    background: var(--bg-card-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.gate-card.current {
    border-left: 3px solid var(--text);
}

.gate-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.gate-card-name {
    font-size: 15px;
    font-weight: 600;
}

.gate-card-tags {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}


/* ══════════════════════════════
   Resource Hub Card (Detail)
   ══════════════════════════════ */

.resource-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 8px 0;
    margin-bottom: 24px;
    background: var(--bg);
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text);
    transition: background var(--transition);
}

.resource-item:hover {
    background: var(--bg-hover);
}

.resource-item .res-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}

.resource-item .res-label {
    flex: 1;
}

.resource-item .res-arrow {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: transform var(--transition);
}

.resource-item:hover .res-arrow {
    transform: translateX(3px);
}


/* ══════════════════════════════
   PRD Summary (Detail page)
   ══════════════════════════════ */

.prd-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--bg);
}

.prd-card .prd-row {
    margin-bottom: 10px;
}

.prd-card .prd-row:last-child {
    margin-bottom: 0;
}

.prd-card .prd-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.prd-card .prd-value {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}


/* ══════════════════════════════
   New Project Placeholder
   ══════════════════════════════ */

.new-project-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-card);
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.new-project-card:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}


/* ══════════════════════════════
   Section Divider
   ══════════════════════════════ */

.section-block {
    margin-bottom: 28px;
}


/* ══════════════════════════════
   Responsive
   ══════════════════════════════ */

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px;
    }

    .main {
        padding: 28px 20px 60px;
    }

    .page-title {
        font-size: 28px;
    }

    .stat-bar {
        grid-template-columns: 1fr;
    }

    .meta-grid {
        grid-template-columns: 1fr 1fr;
    }
}