/* ============================================
   志愿填报智能助手 - Apple Design System CSS
   Apple HIG Compliant v3.0
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Apple Color System */
    --primary: #0066cc;
    --primary-hover: #0070e0;
    --primary-active: #0055b3;
    --primary-rgb: 0, 102, 204;

    /* Accent - Apple Orange */
    --accent: #ff9500;
    --accent-rgb: 255, 149, 0;

    /* Military Green */
    --military: #34c759;
    --military-rgb: 52, 199, 89;

    /* Functional Colors */
    --success: #34c759;
    --success-light: #e8f9ed;
    --success-rgb: 52, 199, 89;
    --warning: #ff9500;
    --warning-light: #fff5e6;
    --warning-rgb: 255, 149, 0;
    --error: #ff3b30;
    --error-light: #ffe5e3;
    --error-rgb: 255, 59, 48;
    --info: #0066cc;
    --info-light: #e8f2ff;

    /* Backgrounds */
    --bg: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #e8e8ed;

    /* Card */
    --card: #ffffff;
    --card-radius: 16px;
    --card-radius-lg: 28px;

    /* Border */
    --border: #d2d2d7;
    --border-light: #e5e5ea;

    /* Text */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --text-inverse: #ffffff;

    /* Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Spacing - 8px base */
    --space-xs: 4px;
    --space-sm: 8px;
    --space: 12px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    --space-4xl: 64px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", sans-serif;

    /* Font Sizes */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-md: 17px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-2xl: 28px;
    --text-3xl: 34px;

    /* Navigation */
    --nav-height: 48px;
    --tab-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-md);
    line-height: 1.47;
    color: var(--text-primary);
    background-color: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

@keyframes shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* ============================================
   Top Navigation Bar
   Pure white, 1px bottom border, no shadow
   ============================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.top-nav .nav-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--primary);
    transition: background-color var(--transition-fast);
}

.top-nav .nav-back:hover {
    background-color: var(--bg-secondary);
}

.top-nav .nav-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 var(--space-sm);
    letter-spacing: -0.01em;
}

.top-nav .nav-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--primary);
    transition: background-color var(--transition-fast);
}

.top-nav .nav-home:hover {
    background-color: var(--bg-secondary);
}

/* ============================================
   Bottom Tab Navigation Bar
   Pure white, 1px top border, active = #0066cc
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--tab-height);
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #ffffff;
    border-top: 1px solid var(--border);
}

.bottom-nav .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    transition: color var(--transition);
    padding-top: 4px;
    position: relative;
}

.bottom-nav .tab-item:hover {
    color: var(--primary);
}

.bottom-nav .tab-item.active {
    color: var(--primary);
}

.bottom-nav .tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
}

.bottom-nav .tab-icon {
    font-size: 22px;
    margin-bottom: 2px;
    line-height: 1;
}

.bottom-nav .tab-label {
    line-height: 1.2;
    font-weight: 500;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    padding-top: calc(var(--nav-height) + var(--space-2xl));
    padding-bottom: calc(var(--tab-height) + var(--space-2xl));
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
}

.main-content.no-bottom-nav {
    padding-bottom: var(--space-2xl);
}

/* ============================================
   Hero Section
   Pure white, centered, no gradient
   ============================================ */
.hero-section {
    padding: var(--space-2xl) var(--space-md) var(--space-3xl);
    text-align: center;
}

.hero-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.18;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    animation: fadeInUp 0.5s ease;
}

.hero-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    line-height: 1.47;
    animation: fadeInUp 0.5s ease 0.08s both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-md);
    animation: fadeInUp 0.5s ease 0.16s both;
}

/* ============================================
   Card Components
   Pure white, 1px border, no shadow
   ============================================ */
.card {
    background: var(--card);
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    padding: var(--space-lg);
    transition: border-color var(--transition-fast);
}

.card:hover {
    border-color: var(--text-tertiary);
}

.card-lg {
    border-radius: var(--card-radius-lg);
    padding: var(--space-xl);
}

.card-flat {
    border: 1px solid var(--border);
}

.card-flat:hover {
    border-color: var(--text-tertiary);
}

/* Entry Cards - edge-to-edge white with border */
.entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--card-radius-lg);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.entry-card:hover {
    border-color: var(--text-tertiary);
}

.entry-card:active {
    background: var(--bg-secondary);
}

.entry-card .entry-icon {
    font-size: 36px;
    margin-right: var(--space-md);
    flex-shrink: 0;
}

.entry-card .entry-content {
    flex: 1;
    min-width: 0;
}

.entry-card .entry-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.entry-card .entry-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.47;
}

.entry-card .entry-arrow {
    flex-shrink: 0;
    color: #c7c7cc;
    transition: transform var(--transition);
}

.entry-card:hover .entry-arrow {
    transform: translateX(2px);
}

/* ============================================
   Quick Tools Area
   Dividers instead of cards
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-sm);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-fast);
}

.tool-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--border);
}

.tool-item:hover {
    background-color: var(--bg-secondary);
}

.tool-item:active {
    background-color: var(--bg-tertiary);
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.tool-icon.blue {
    background: var(--info-light);
}

.tool-icon.green {
    background: var(--success-light);
}

.tool-icon.amber {
    background: var(--warning-light);
}

.tool-icon.purple {
    background: #f3e8ff;
}

.tool-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}

/* ============================================
   Data Overview
   Clean 2x2 grid, large numbers
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space);
}

.stat-card {
    background: var(--card);
    border-radius: var(--card-radius);
    padding: var(--space-lg);
    border: 1px solid var(--border);
    text-align: center;
    transition: border-color var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--text-tertiary);
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-value.green {
    color: var(--military);
}

.stat-value.amber {
    color: var(--accent);
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ============================================
   Form Components
   Apple-style inputs with bottom border focus
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

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

.form-input,
.form-select {
    width: 100%;
    height: 48px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 0 var(--space-sm);
    font-size: var(--text-md);
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: border-color var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus,
.form-select:focus {
    border-bottom-color: var(--primary);
    background: #ffffff;
}

.form-input:disabled,
.form-input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-bottom-color: var(--border-light);
}

.form-input.error,
.form-select.error {
    border-bottom-color: var(--error);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: var(--space-xs);
    display: none;
    animation: shake 0.3s ease;
}

.form-error.show {
    display: block;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Radio Group - pill buttons */
.radio-group {
    display: flex;
    gap: var(--space-sm);
}

.radio-item {
    flex: 1;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.radio-item label:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.radio-item input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
}

/* Form Hint */
.form-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius);
    background: var(--info-light);
    font-size: var(--text-sm);
    color: var(--primary);
    line-height: 1.6;
}

.form-hint svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================
   Button Components
   Solid #0066cc, no gradient, no shadow
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 48px;
    padding: 0 var(--space-xl);
    border-radius: var(--radius);
    font-size: var(--text-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.btn:active {
    opacity: 0.8;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    background: var(--primary-active);
    opacity: 0.8;
}

.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Secondary Button */
.btn-secondary {
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--info-light);
}

/* Danger Button */
.btn-danger {
    background: var(--error);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: #e6352b;
}

/* Military Button */
.btn-military {
    background: var(--military);
    color: var(--text-inverse);
}

.btn-military:hover {
    background: #2eb84e;
}

/* Full Width Button */
.btn-block {
    width: 100%;
}

/* Small Button */
.btn-sm {
    height: 36px;
    padding: 0 var(--space);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}

/* Large Button */
.btn-lg {
    height: 52px;
    font-size: var(--text-md);
    border-radius: var(--radius);
}

/* ============================================
   Step Indicator
   Simplified: small dots + thin lines
   ============================================ */
.step-indicator {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-md) var(--space-sm);
    gap: 0;
    user-select: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.step-indicator::-webkit-scrollbar {
    display: none;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 0;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    transition: all var(--transition);
    position: relative;
    z-index: 1;
}

.step-item.active .step-circle {
    background: var(--primary);
    color: var(--text-inverse);
}

.step-item.completed .step-circle {
    background: var(--success);
    color: var(--text-inverse);
}

.step-label {
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    max-width: 60px;
    transition: color var(--transition);
}

.step-item.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step-item.completed .step-label {
    color: var(--success);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--bg-tertiary);
    margin: 0 var(--space-xs);
    margin-bottom: 20px;
    border-radius: 1px;
    transition: background-color var(--transition);
    min-width: 20px;
    max-width: 56px;
}

.step-line.active {
    background: var(--primary);
}

.step-line.completed {
    background: var(--success);
}

/* ============================================
   Result Section
   ============================================ */
.result-section {
    display: none;
    margin-top: var(--space-2xl);
}

.result-section.show {
    display: block;
    animation: fadeInUp 0.35s ease;
}

/* Result Table - no outer border, row dividers */
.result-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--card-radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.result-table thead th {
    background: var(--bg-secondary);
    padding: var(--space-sm) var(--space);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.result-table tbody td {
    padding: var(--space) var(--space-md);
    font-size: var(--text-md);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.result-table tbody tr:last-child td {
    border-bottom: none;
}

.result-table tbody tr:hover {
    background: var(--bg-secondary);
}

.score-diff-positive {
    color: var(--success);
    font-weight: 600;
}

.score-diff-negative {
    color: var(--error);
    font-weight: 600;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 260px;
    margin-top: var(--space);
    background: var(--card);
    border-radius: var(--card-radius);
    padding: var(--space-md);
    border: 1px solid var(--border);
}

/* Analysis Card - left color bar */
.analysis-card {
    background: var(--card);
    border-radius: var(--card-radius);
    padding: var(--space-lg);
    margin-top: var(--space-md);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    transition: border-color var(--transition-fast);
}

.analysis-card:hover {
    border-color: var(--text-tertiary);
    border-left-color: var(--primary);
}

.analysis-card.warning {
    border-left-color: var(--accent);
}

.analysis-card.warning:hover {
    border-color: var(--text-tertiary);
    border-left-color: var(--accent);
}

.analysis-card.success {
    border-left-color: var(--success);
}

.analysis-card.success:hover {
    border-color: var(--text-tertiary);
    border-left-color: var(--success);
}

.analysis-card h4 {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: -0.01em;
}

.analysis-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.analysis-card .highlight {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Toast Notifications
   Minimal, no rounded corners, slide from top
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + var(--space));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    pointer-events: none;
    width: calc(100% - var(--space-xl));
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    font-size: var(--text-sm);
    line-height: 1.47;
    color: var(--text-inverse);
    background: var(--text-primary);
    pointer-events: auto;
    animation: toast-in 0.25s ease forwards;
    width: 100%;
}

.toast.toast-out {
    animation: toast-out 0.2s ease forwards;
}

.toast.toast-success {
    background: var(--success);
}

.toast.toast-warning {
    background: var(--warning);
    color: var(--text-primary);
}

.toast.toast-error {
    background: var(--error);
}

.toast.toast-info {
    background: var(--primary);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-message {
    flex: 1;
    word-break: break-word;
}

/* ============================================
   Tag Selector (Pill Style)
   Selected: white bg + 1px blue border + blue text
   ============================================ */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tag-selected,
.tag-unselected {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.tag-unselected {
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.tag-unselected:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tag-unselected:active {
    background: var(--bg-secondary);
}

.tag-selected {
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--primary);
    font-weight: 600;
}

.tag-selected:active {
    background: var(--info-light);
}

/* ============================================
   Loading Spinner
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-spinner.large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 8000;
}

.loading-text {
    text-align: center;
    margin-top: var(--space);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-secondary) 37%, var(--border-light) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 22px;
    margin-bottom: var(--space-md);
    width: 70%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--card-radius);
    margin-bottom: var(--space);
}

/* ============================================
   Accordion
   ============================================ */
.accordion {
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
}

.accordion-item {
    border-bottom: 1px solid var(--border-light);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    cursor: pointer;
    user-select: none;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
}

.accordion-header:hover {
    background: var(--bg-secondary);
}

.accordion-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform var(--transition-slow);
    flex-shrink: 0;
}

.accordion-item.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow), opacity 0.25s ease;
    opacity: 0;
    padding: 0 var(--space-lg);
}

.accordion-item.open .accordion-body {
    max-height: 1000px;
    opacity: 1;
    padding: 0 var(--space-lg) var(--space-lg);
}

/* ============================================
   Card Expand
   ============================================ */
.card-expand {
    background: var(--card);
    border-radius: var(--card-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color var(--transition-fast);
}

.card-expand:active {
    background: var(--bg-secondary);
}

.card-expand.expanded {
    border-color: var(--text-tertiary);
}

.card-expand-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow), opacity 0.25s ease;
    opacity: 0;
    padding: 0 var(--space-lg);
}

.card-expand.expanded .card-expand-body {
    max-height: 800px;
    opacity: 1;
    padding: var(--space) var(--space-lg) var(--space-lg);
}

.card-expand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    cursor: pointer;
    user-select: none;
}

.card-expand-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-slow);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.card-expand.expanded .card-expand-arrow {
    transform: rotate(180deg);
}

/* ============================================
   Tab Bar
   ============================================ */
.tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar .tab-item {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: var(--space) var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.tab-bar .tab-item::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: width var(--transition-slow);
}

.tab-bar .tab-active {
    color: var(--primary);
    font-weight: 600;
}

.tab-bar .tab-active::after {
    width: 60%;
}

.tab-bar .tab-item:hover {
    color: var(--primary);
}

/* ============================================
   Footer
   ============================================ */
.footer-section {
    text-align: center;
    padding: var(--space-2xl) var(--space-md) var(--space-3xl);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-section .disclaimer {
    margin-top: var(--space-sm);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ============================================
   System Entry Button Group
   ============================================ */
.system-entry-group {
    display: flex;
    flex-direction: column;
    gap: var(--space);
    margin-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.btn-system-entry {
    width: 100%;
    height: 52px;
    border-radius: var(--radius);
    font-size: var(--text-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-inverse);
    letter-spacing: -0.01em;
}

.btn-system-entry:hover {
    opacity: 0.9;
}

.btn-system-entry:active {
    opacity: 0.8;
}

.btn-system-entry.blue {
    background: var(--primary);
}

.btn-system-entry.green {
    background: var(--military);
}

/* ============================================
   Save Button
   ============================================ */
.btn-save {
    width: 100%;
    height: 48px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--primary);
    font-size: var(--text-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    letter-spacing: -0.01em;
}

.btn-save:hover {
    background: var(--info-light);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-tertiary) transparent;
}

/* ============================================
   Safe Area
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: var(--safe-bottom);
        height: calc(var(--tab-height) + var(--safe-bottom));
    }

    .main-content {
        padding-bottom: calc(var(--tab-height) + var(--space-2xl) + var(--safe-bottom));
    }

    .main-content.no-bottom-nav {
        padding-bottom: calc(var(--space-2xl) + var(--safe-bottom));
    }
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Small phone (<=374px) */
@media screen and (max-width: 374px) {
    html {
        font-size: 14px;
    }

    .step-indicator {
        padding: var(--space-sm) var(--space-xs);
    }

    .step-circle {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .step-label {
        font-size: 10px;
    }

    .step-line {
        min-width: 14px;
        max-width: 36px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-section {
        padding: var(--space-xl) var(--space-md) var(--space-2xl);
    }

    .entry-card {
        padding: var(--space-md);
    }

    .entry-card .entry-icon {
        font-size: 28px;
    }

    .entry-card .entry-title {
        font-size: var(--text-sm);
    }

    .entry-card .entry-desc {
        font-size: var(--text-xs);
    }

    .tools-grid {
        gap: 0;
    }

    .tool-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .tool-label {
        font-size: 10px;
    }

    .toast {
        font-size: var(--text-xs);
        padding: var(--space-sm) var(--space);
    }

    .toast-container {
        width: calc(100% - var(--space-md));
    }

    .tag-selected,
    .tag-unselected {
        padding: 6px var(--space);
        font-size: var(--text-xs);
    }
}

/* Standard phone (375px - 429px) */
@media screen and (min-width: 375px) and (max-width: 429px) {
    .step-indicator {
        padding: var(--space-md) var(--space-sm);
    }

    .step-line {
        min-width: 20px;
        max-width: 48px;
    }
}

/* Large phone (430px+) */
@media screen and (min-width: 430px) {
    .step-indicator {
        padding: var(--space-xl) var(--space-lg);
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: var(--text-sm);
    }

    .step-label {
        font-size: var(--text-xs);
    }

    .step-line {
        min-width: 32px;
        max-width: 72px;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-section {
        padding: var(--space-3xl) var(--space-xl) var(--space-3xl);
    }

    .entry-card {
        padding: var(--space-xl) var(--space-lg);
    }

    .entry-card .entry-icon {
        font-size: 40px;
    }

    .entry-card .entry-title {
        font-size: var(--text-lg);
    }

    .entry-card .entry-desc {
        font-size: var(--text-sm);
    }

    .tag-selected,
    .tag-unselected {
        padding: 10px var(--space-lg);
        font-size: var(--text-sm);
    }
}

/* Tablet (768px+) */
@media screen and (min-width: 768px) {
    .toast-container {
        max-width: 480px;
    }

    .step-indicator {
        padding: var(--space-xl) var(--space-3xl);
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: var(--text-base);
    }

    .step-label {
        font-size: var(--text-sm);
    }

    .step-line {
        min-width: 40px;
        max-width: 120px;
    }

    .card,
    .card-expand,
    .accordion {
        border-radius: var(--card-radius-lg);
    }

    .tag-group {
        gap: 10px;
    }

    .hero-title {
        font-size: 40px;
    }
}

/* Desktop (1024px+) */
@media screen and (min-width: 1024px) {
    .toast-container {
        max-width: 560px;
    }

    .step-indicator {
        padding: var(--space-2xl) var(--space-3xl);
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: var(--text-md);
    }

    .step-line {
        min-width: 48px;
        max-width: 160px;
    }

    .hero-title {
        font-size: 48px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-secondary); }
.text-inverse { color: var(--text-inverse); }

.bg-primary { background-color: var(--primary); }
.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-error { background-color: var(--error); }
.bg-card { background-color: var(--card); }

.border-primary { border-color: var(--primary); }
.border-success { border-color: var(--success); }
.border-error { border-color: var(--error); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap { gap: var(--space); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt { margin-top: var(--space); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb { margin-bottom: var(--space); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p { padding: var(--space); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.relative { position: relative; }
.absolute { position: absolute; }

.animate-fadeInUp { animation: fadeInUp 0.35s ease; }
.animate-fadeIn { animation: fadeIn 0.25s ease; }
.animate-scaleIn { animation: scaleIn 0.25s ease; }

/* ============================================
   Military & Tools Page Components
   Apple-style additions
   ============================================ */

/* Tip/Info Bar */
.tip-bar {
    padding: var(--space-md);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}
.tip-bar.green {
    background: var(--success-light);
    border-color: #c6f0cf;
    color: #1a5c2e;
}
.tip-bar.gold {
    background: var(--warning-light);
    border-color: #ffe0b2;
    color: #7a5200;
}

/* Card Header & Body */
.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-md);
}
.card-header h3 {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.card-body {
    padding: 0;
}

/* Filter Bar */
.filter-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}
.filter-bar h3 {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space);
}
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-item label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.filter-input {
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 var(--space);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color var(--transition-fast);
}
.filter-input:focus {
    border-color: var(--primary);
    background: #ffffff;
}

/* Filter Tags (for policies & military) */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.filter-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.filter-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-tag.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    font-weight: 600;
}

/* Search Bar */
.search-bar {
    position: relative;
}
.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}
.search-bar input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 var(--space-md) 0 40px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: none;
    transition: border-color var(--transition-fast);
}
.search-bar input:focus {
    border-color: var(--primary);
    background: #ffffff;
}

/* Policy Card */
.policy-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    margin-bottom: var(--space);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}
.policy-card:hover {
    border-color: var(--text-tertiary);
}
.policy-card-header {
    display: flex;
    align-items: center;
    padding: var(--space-lg);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}
.policy-card-header:hover {
    background: var(--bg-secondary);
}
.policy-card-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.policy-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.policy-card-arrow {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    transition: transform var(--transition-slow);
    margin-left: var(--space-sm);
}
.policy-card.open .policy-card-arrow {
    transform: rotate(180deg);
}
.policy-card-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
    padding: 0 var(--space-lg);
}
.policy-card.open .policy-card-detail {
    max-height: 500px;
    padding: 0 var(--space-lg) var(--space-lg);
}
.policy-card-detail p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Policy Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}
.tag-type {
    background: var(--info-light);
    color: var(--primary);
}
.tag-affiliation {
    background: var(--success-light);
    color: #1a7a3a;
}
.tag-medical {
    background: #fff5e6;
    color: #b36b00;
}
.tag-female {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Tool Card (for tools page) */
.tool-card {
    display: flex;
    align-items: center;
    padding: var(--space-lg);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    margin-bottom: var(--space);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}
.tool-card:hover {
    border-color: var(--text-tertiary);
}
.tool-card:active {
    background: var(--bg-secondary);
}
.tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    flex-shrink: 0;
}
.tool-card-icon.blue { background: var(--info-light); color: var(--primary); }
.tool-card-icon.green { background: var(--success-light); color: var(--success); }
.tool-card-icon.gold { background: var(--warning-light); color: var(--accent); }
.tool-card-icon.gray { background: var(--bg-secondary); color: var(--text-secondary); }
.tool-card-content {
    flex: 1;
    min-width: 0;
}
.tool-card-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}
.tool-card-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
}
.tool-card-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: transform var(--transition-slow);
}
.tool-card.open .tool-card-arrow {
    transform: rotate(180deg);
}
.tool-card-body {
    display: none;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    margin-top: -1px;
    margin-bottom: var(--space);
}
.tool-card-body.show {
    display: block;
}

/* Conclusion Box */
.conclusion-box {
    border-radius: var(--card-radius);
    padding: var(--space-xl);
    text-align: center;
    margin-top: var(--space-md);
}
.conclusion-box.pass {
    background: var(--success-light);
    border: 1px solid #c6f0cf;
}
.conclusion-box.fail {
    background: var(--error-light);
    border: 1px solid #fecaca;
}
.conclusion-icon {
    margin-bottom: var(--space-sm);
}
.conclusion-text {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.conclusion-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Info Row */
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}
.info-row:last-child {
    border-bottom: none;
}
.info-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.info-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--border-light);
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}
.faq-arrow {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    transition: transform var(--transition-slow);
}
.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
    padding: 0;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 0 var(--space-md);
}
.faq-answer p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Step Navigation */
.step-nav {
    display: flex;
    gap: var(--space);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
}
.btn-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 48px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}
.btn-nav-prev {
    background: var(--card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-nav-prev:hover {
    background: var(--bg-secondary);
}
.btn-nav-next {
    background: var(--primary);
    color: var(--text-inverse);
    border: 1px solid var(--primary);
}
.btn-nav-next:hover {
    background: var(--primary-hover);
}

/* Selected Bar */
.selected-bar {
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--card);
    border-top: 1px solid var(--border);
}
.selected-info {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.selected-info .count {
    font-weight: 700;
    color: var(--primary);
}
.btn-go-next {
    height: 40px;
    padding: 0 var(--space-lg);
    border-radius: var(--radius);
    background: var(--military);
    color: var(--text-inverse);
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}
.btn-go-next:hover {
    background: #2eb84e;
}

/* Analysis Panel */
.analysis-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    margin-bottom: var(--space-md);
    overflow: hidden;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}
.panel-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.panel-icon.green { background: var(--success-light); color: var(--success); }
.panel-icon.blue { background: var(--info-light); color: var(--primary); }
.panel-icon.gold { background: var(--warning-light); color: var(--accent); }
.panel-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-md);
}
.empty-state svg {
    margin-bottom: var(--space-md);
}
.empty-state p {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space);
}

/* Container (legacy compat) */
.container {
    max-width: 480px;
    margin: 0 auto;
}

/* Outline Button */
.btn-outline {
    height: 44px;
    padding: 0 var(--space-lg);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 600;
    border: 1px solid var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}
.btn-outline:hover {
    background: var(--info-light);
}

/* ============================================
   Military Step 4 & 5 Specific Components
   ============================================ */

/* Gradient Setting */
.gradient-setting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
}
.gradient-item {
    text-align: center;
}
.g-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-xs);
}
.g-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.gradient-plus {
    font-size: var(--text-lg);
    color: var(--text-tertiary);
    font-weight: 300;
}

/* Volunteer Table */
.volunteer-table {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    margin-bottom: var(--space-md);
}
.volunteer-header {
    display: grid;
    grid-template-columns: 40px 1fr 60px 100px;
    align-items: center;
    padding: var(--space) var(--space-md);
    background: var(--bg-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-light);
}
.volunteer-row {
    display: grid;
    grid-template-columns: 40px 1fr 60px 100px;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}
.volunteer-row:last-child {
    border-bottom: none;
}
.volunteer-row:hover {
    background: var(--bg-secondary);
}
.volunteer-seq {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
}
.volunteer-info {
    min-width: 0;
}
.volunteer-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.volunteer-major {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}
.volunteer-actions {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}
.volunteer-actions .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.volunteer-actions .btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.volunteer-actions .btn-sm.danger:hover {
    border-color: var(--error);
    color: var(--error);
}

/* Probability Badge */
.prob-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}
.prob-rush {
    background: var(--warning-light);
    color: #b36b00;
}
.prob-stable {
    background: var(--info-light);
    color: var(--primary);
}
.prob-safe {
    background: var(--success-light);
    color: #1a7a3a;
}

/* Strategy Item */
.strategy-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}
.strategy-item:last-child {
    border-bottom: none;
}
.strategy-num {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}
.strategy-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}
.strategy-text strong {
    color: var(--text-primary);
}

/* Checklist Progress */
.checklist-progress {
    margin-bottom: var(--space-md);
}
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}
.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.progress-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Checklist Item */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}
.checklist-item:last-child {
    border-bottom: none;
}
.checklist-item:hover {
    background: var(--bg-secondary);
    margin: 0 calc(var(--space-lg) * -1);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
}
.custom-checkbox {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    margin-top: 1px;
}
.custom-checkbox svg {
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.custom-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}
.custom-checkbox.checked svg {
    opacity: 1;
}
.checklist-text {
    flex: 1;
    min-width: 0;
}
.checklist-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}
.checklist-sub {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: var(--space-xl);
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: calc(var(--space-xl) * -1 + 1px);
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
}
.timeline-item.done .timeline-dot {
    background: var(--success);
    border-color: var(--success);
}
.timeline-item.active .timeline-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
}
.timeline-month {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.timeline-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
}
.badge-done {
    background: var(--success-light);
    color: #1a7a3a;
}
.badge-active {
    background: var(--info-light);
    color: var(--primary);
}
.badge-future {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}
.timeline-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}
.timeline-desc {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Contact Item */
.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}
.contact-item:last-child {
    border-bottom: none;
}
.contact-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.contact-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 1px;
}
.contact-link {
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
}
.contact-link:hover {
    text-decoration: underline;
}
.contact-detail {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* ============================================
   Step Navigation (Prev/Next Buttons)
   ============================================ */
.step-nav {
    display: flex;
    gap: var(--space);
    margin-top: var(--space-xl);
    padding-bottom: var(--space-md);
}

.step-nav .btn-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 48px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    letter-spacing: -0.01em;
}

.step-nav .btn-nav-prev {
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.step-nav .btn-nav-prev:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.step-nav .btn-nav-next {
    background: var(--primary);
    color: var(--text-inverse);
    border: 1px solid var(--primary);
}

.step-nav .btn-nav-next:hover {
    background: var(--primary-hover);
}

/* ============================================
   Info Card (hint/tip box)
   ============================================ */
.info-card {
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.info-card p {
    font-size: var(--text-base);
    color: var(--text-primary);
    line-height: 1.47;
    margin: 0;
}

/* ============================================
   Section Title (h3 style for sub-sections)
   ============================================ */
.section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
    letter-spacing: -0.01em;
}

/* ============================================
   Summary Card (blue background info card)
   ============================================ */
.summary-card {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--text-inverse);
}

.summary-card .summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.summary-card .summary-header span {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-inverse);
}

.summary-card .summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space);
    font-size: var(--text-sm);
}

.summary-card .summary-grid .summary-item-label {
    color: rgba(255, 255, 255, 0.7);
}

.summary-card .summary-grid .summary-item-value {
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--text-inverse);
}

/* ============================================
   Filter Grid (for step2 filters)
   ============================================ */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.filter-grid .form-select {
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 var(--space);
    font-size: var(--text-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
    outline: none;
}

.search-input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 var(--space) 0 36px;
    font-size: var(--text-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

/* ============================================
   Tab Buttons (Chong/Wen/Bao for step2)
   ============================================ */
.tab-btn-group {
    display: flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--card);
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: all var(--transition-fast);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn .tab-count {
    margin-left: 4px;
    font-size: var(--text-xs);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    padding: 1px 6px;
}

.tab-btn.active .tab-count {
    background: var(--primary);
    color: var(--text-inverse);
}

/* ============================================
   Tab Content Panels
   ============================================ */
.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* ============================================
   Pref Tag (for step3 preference tags)
   ============================================ */
.pref-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.pref-tag.tag-unselected {
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pref-tag.tag-unselected:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pref-tag.tag-unselected:active {
    background: var(--bg-secondary);
}

.pref-tag.tag-selected {
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--primary);
    font-weight: 600;
}

.pref-tag.tag-selected:active {
    background: var(--info-light);
}

/* ============================================
   Gradient Stats Grid (for step4)
   ============================================ */
.gradient-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space);
}

.gradient-stat {
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.gradient-stat .stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.2;
}

.gradient-stat .stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
}

.gradient-stat.chong .stat-value { color: var(--error); }
.gradient-stat.wen .stat-value { color: var(--warning); }
.gradient-stat.bao .stat-value { color: var(--success); }

/* ============================================
   Gradient Bar (for step4)
   ============================================ */
.gradient-bar {
    display: flex;
    height: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
}

/* ============================================
   Action Buttons Row (for step4)
   ============================================ */
.action-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.btn-optimize {
    flex: 1;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--text-inverse);
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-optimize:hover {
    background: var(--primary-hover);
}

.btn-export {
    flex: 1;
    height: 40px;
    border-radius: var(--radius);
    background: var(--card);
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-export:hover {
    border-color: var(--primary);
}

/* ============================================
   Vision Row (for step5 dual inputs)
   ============================================ */
.vision-row {
    display: flex;
    gap: var(--space-sm);
}

.vision-row .form-input {
    flex: 1;
}

/* ============================================
   Card Title (h2 inside cards)
   ============================================ */
.card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-xl) 0;
}

/* ============================================
   Overflow X Auto wrapper
   ============================================ */
.overflow-x-auto {
    overflow-x: auto;
}

/* ============================================
   Margin bottom utility for sections
   ============================================ */
.mb-section {
    margin-bottom: var(--space-md);
}
