/* styles.css — Serif Design System v2.0 */
/* 编辑排版 · 古典克制 · 中文优化 */

/* ============================================
   1. CSS Reset & Design Tokens
   ============================================ */

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

:root {
    /* --- Colors --- */
    --background: #FAFAF8;
    --foreground: #1A1A1A;
    --muted: #F5F3F0;
    --muted-foreground: #6B6B6B;
    --accent: #B8860B;
    --accent-secondary: #D4A84B;
    --accent-foreground: #FFFFFF;
    --accent-muted: rgba(184, 134, 11, 0.06);
    --border: #E8E4DF;
    --border-hover: #D4CFC8;
    --card: #FFFFFF;
    --ring: #B8860B;
    --input: #E8E4DF;

    /* Legacy aliases for JS compatibility */
    --primary-color: #B8860B;
    --secondary-color: #D4A84B;
    --accent-color: #B8860B;
    --background-color: #FAFAF8;
    --card-background: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --border-color: #E8E4DF;

    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04);
    --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.06);
    --shadow-lg: 0 8px 24px rgba(26, 26, 26, 0.08);
    --shadow-accent: 0 4px 12px rgba(184, 134, 11, 0.15);

    /* --- Typography --- */
    --font-display: "Playfair Display", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
    --font-body: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", "SF Mono", "Fira Code", monospace;

    /* --- Radii --- */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* --- Transitions --- */
    --transition: all 200ms ease-out;
    --transition-subtle: all 150ms ease-out;
    --transition-slow: all 300ms ease-out;

    /* --- Spacing --- */
    --section-padding: 64px;
    --content-max-width: 64rem;
    --container-padding: 20px;
}

/* --- Paper Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Ambient Glow --- */
body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 134, 11, 0.02), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.75;
    letter-spacing: 0.01em;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
    position: relative;
    z-index: 1;
}

/* ============================================
   2. Section Rules
   ============================================ */

.section {
    display: none;
}

.section.active {
    display: block;
    animation: sectionFadeIn 0.5s ease-out;
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Label Pattern */
.section-label {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-label::before,
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-label span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
}

/* ============================================
   3. Header
   ============================================ */

.header {
    text-align: center;
    padding: 32px 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.header::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin: 16px auto 0;
}

.header .logo {
    font-family: var(--font-display);
    font-size: 2.5em;
    font-weight: 700;
    color: var(--foreground);
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.header .tagline {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--muted-foreground);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Hero mode header */
body.hero-mode {
    background-color: var(--background);
}

body.hero-mode .header {
    text-align: center;
    padding: 20px 24px;
    background: var(--card);
    color: var(--foreground);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

body.hero-mode .header:hover {
    box-shadow: var(--shadow-md);
}

body.hero-mode .header .logo {
    font-family: var(--font-display);
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.01em;
    color: var(--foreground);
}

body.hero-mode .header .tagline {
    font-size: 0.875rem;
    opacity: 0.7;
    margin: 0;
    color: var(--muted-foreground);
}

/* ============================================
   4. Hero Section
   ============================================ */

.hero-section {
    position: relative;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--background);
    padding: 60px 20px;
}

/* Background decoration — subtle ambient glow */
.hero-bg-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: orbFloat 12s ease-in-out infinite;
}

.hero-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.hero-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -4s;
}

.hero-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -7s;
    opacity: 0.08;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -15px) scale(1.03); }
    50% { transform: translate(-15px, 20px) scale(0.97); }
    75% { transform: translate(15px, 15px) scale(1.01); }
}

.hero-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(184, 134, 11, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184, 134, 11, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    width: 100%;
    text-align: center;
}

/* Badge */
.hero-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: var(--radius-sm);
    background: var(--muted);
    border: 1px solid var(--border);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 28px;
    animation: heroFadeIn 1s ease-out 0.2s both;
}

/* Hero Title — dramatic serif display */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5em);
    font-weight: 400;
    color: var(--foreground);
    line-height: 1.15;
    margin-bottom: 20px;
    animation: heroFadeIn 1s ease-out 0.4s both;
    letter-spacing: -0.02em;
}

.hero-highlight {
    color: var(--accent);
    font-style: italic;
    -webkit-text-fill-color: var(--accent);
}

.hero-highlight-alt {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
}

/* Subtitle */
.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.125rem;
    color: var(--muted-foreground);
    margin-bottom: 36px;
    line-height: 1.75;
    animation: heroFadeIn 1s ease-out 0.6s both;
}

/* Six-stage features */
.hero-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: heroFadeIn 1s ease-out 0.8s both;
}

.hero-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1px solid var(--border);
    transition: var(--transition);
    min-width: 72px;
    cursor: default;
}

.hero-feature-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    background: var(--accent-muted);
}

.hero-feature-icon {
    font-size: 1.4em;
}

.hero-feature-text {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--foreground);
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.hero-feature-arrow {
    color: var(--border);
    font-size: 1.1em;
    font-weight: 300;
    user-select: none;
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Input card */
.hero-input-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    animation: heroFadeIn 1s ease-out 1s both;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-slow);
}

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

.hero-input-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 0 0 10px 10px;
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; width: 40%; }
    50% { opacity: 1; width: 60%; }
}

.hero-input-group {
    margin-bottom: 20px;
    text-align: left;
}

.hero-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.9rem;
}

.hero-label-icon {
    font-size: 1em;
}

.hero-label-optional {
    color: var(--muted-foreground);
    font-size: 0.8em;
    font-weight: 400;
}

.hero-input,
.hero-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: transparent;
    color: var(--foreground);
    transition: var(--transition);
    font-family: var(--font-body);
    line-height: 1.5;
}

.hero-input::placeholder,
.hero-textarea::placeholder {
    color: var(--muted-foreground);
    opacity: 0.6;
}

.hero-input:focus,
.hero-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.hero-textarea {
    min-height: 80px;
    resize: vertical;
}

/* Start button */
.hero-start-btn {
    width: 100%;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: var(--accent);
    color: var(--accent-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
    overflow: hidden;
    margin-top: 8px;
    letter-spacing: 0.05em;
    min-height: 44px;
    touch-action: manipulation;
    font-family: var(--font-body);
}

.hero-start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms ease-out;
    z-index: -1;
}

.hero-start-btn:hover::before {
    transform: scaleX(1);
}

.hero-start-btn:hover {
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.hero-start-btn:active {
    transform: translateY(0);
}

.hero-btn-text {
    letter-spacing: 0.05em;
}

.hero-btn-arrow {
    font-size: 1.2em;
    transition: transform 200ms ease-out;
}

.hero-start-btn:hover .hero-btn-arrow {
    transform: translateX(4px);
}

/* Trust badges */
.hero-trust {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
    animation: heroFadeIn 1s ease-out 1.2s both;
    flex-wrap: wrap;
}

.hero-trust-item {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 400;
    transition: color 200ms ease-out;
    letter-spacing: 0.02em;
}

.hero-trust-item:hover {
    color: var(--accent);
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   5. Input Groups (General)
   ============================================ */

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--muted-foreground);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
    background: transparent;
    color: var(--foreground);
    font-family: var(--font-body);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   6. Buttons
   ============================================ */

.primary-btn {
    background: var(--accent);
    color: var(--accent-foreground);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.05em;
    font-family: var(--font-body);
}

.primary-btn:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: translateY(0);
}

/* ============================================
   7. Progress Dashboard
   ============================================ */

.progress-overview {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.progress-overview h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--foreground);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.progress-overview h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--accent);
    margin-top: 12px;
}

.progress-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.progress-ring {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#progress-percent {
    display: block;
    font-family: var(--font-display);
    font-size: 2.2em;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
}

.progress-label {
    display: block;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

#progress-circle {
    transition: stroke-dashoffset 1s ease-out;
}

/* Stats */
.stats-info {
    display: flex;
    gap: 20px;
    flex: 1;
    min-width: 280px;
}

.stat-item {
    background: var(--muted);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    flex: 1;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    background: var(--card);
}

.stat-item h3 {
    font-family: var(--font-display);
    color: var(--accent);
    margin-bottom: 4px;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.3;
}

.stat-item p {
    font-size: 0.9375rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* ============================================
   8. Control Panel
   ============================================ */

.control-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-left: auto;
    flex-wrap: wrap;
}

.model-display {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted-foreground);
    background: var(--muted);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.model-config-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.model-config-btn:hover {
    background: var(--muted);
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(30deg);
}

.model-config-content {
    max-width: 420px !important;
    width: 90% !important;
    margin: 10% auto !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.model-config-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--accent);
    color: var(--accent-foreground);
}

.model-config-content .modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--accent-foreground);
    font-family: var(--font-display);
    font-weight: 400;
}

.model-config-content .close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--accent-foreground);
    opacity: 0.8;
    transition: var(--transition);
    line-height: 1;
}

.model-config-content .close-modal:hover {
    opacity: 1;
}

.model-config-content .modal-body {
    padding: 20px;
}

.model-config-content .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: var(--muted);
    border-top: 1px solid var(--border);
}

.config-field {
    margin-bottom: 16px;
}

.config-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--muted-foreground);
}

.config-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: var(--transition);
    background: transparent;
    color: var(--foreground);
    font-family: var(--font-body);
}

.config-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-foreground);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    letter-spacing: 0.03em;
    font-family: var(--font-body);
}

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

.btn-secondary {
    background: var(--muted);
    color: var(--muted-foreground);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--foreground);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector label {
    font-weight: 500;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.model-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    color: var(--foreground);
}

.model-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

/* Reset button */
.reset-section {
    display: flex;
    align-items: center;
}

.reset-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    min-height: 44px;
    touch-action: manipulation;
    font-family: var(--font-body);
}

.reset-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: rgba(192, 57, 43, 0.04);
}

.reset-btn:active {
    transform: translateY(0);
}

.reset-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* ============================================
   9. Main Dashboard Layout
   ============================================ */

.main-dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    min-height: 600px;
    align-items: start;
}

/* ============================================
   10. Phases Sidebar
   ============================================ */

.phases-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    min-height: 500px;
    transition: var(--transition);
}

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

.phases-container h3 {
    margin: 0 0 20px 0;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.phases-container h3::after {
    content: '';
    display: block;
    width: 30px;
    height: 1px;
    background: var(--accent);
    margin-top: 8px;
}

.phases-list {
    display: grid;
    gap: 12px;
}

.phase-card {
    background: var(--muted);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.phase-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 200ms ease-out;
}

.phase-card:hover::before {
    transform: scaleX(1);
}

.phase-card:hover {
    border-color: var(--border-hover);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.phase-card.active {
    background: var(--card);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.phase-card.active::before {
    transform: scaleX(1);
}

.phase-card.completed {
    opacity: 0.7;
    background: var(--accent-muted);
}

.phase-card.completed::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
}

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

.phase-name {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.95rem;
    line-height: 1.3;
}

.phase-status {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.phase-description {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Phase details */
.phase-details {
    animation: slideIn 0.3s ease-out;
}

.phase-details-header {
    margin-bottom: 16px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 5px 0;
    transition: var(--transition);
    font-family: var(--font-body);
}

.back-btn:hover {
    color: var(--foreground);
}

.phase-details-content {
    background: var(--muted);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
}

.phase-task-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.phase-task-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.phase-task-list li:last-child {
    border-bottom: none;
}

.phase-task-list li::before {
    content: '—';
    color: var(--accent);
    margin-right: 10px;
    font-weight: 600;
}

/* Phase detail header */
.phase-detail-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.phase-detail-header h4 {
    margin: 0 0 8px 0;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.3;
}

.phase-progress-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.phase-duration {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.phase-status-badge {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.phase-status-badge.completed {
    background: var(--accent-muted);
    color: var(--accent);
}

.phase-status-badge.active {
    background: var(--accent-muted);
    color: var(--accent);
}

.phase-status-badge.pending {
    background: var(--muted);
    color: var(--muted-foreground);
}

.phase-description-detail {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius-md);
    border-left: 2px solid var(--accent);
}

.phase-description-detail p {
    color: var(--muted-foreground);
    line-height: 1.75;
    margin: 0;
}

.phase-tasks-section {
    margin-bottom: 16px;
}

.phase-tasks-section h5 {
    margin: 0 0 12px 0;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 400;
}

.phase-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.switch-phase-btn {
    background: var(--accent);
    color: var(--accent-foreground);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    width: 100%;
    letter-spacing: 0.03em;
    font-family: var(--font-body);
}

.switch-phase-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.switch-phase-btn:active {
    transform: translateY(0);
}

.phase-card.active .switch-phase-btn {
    background: var(--muted-foreground);
    cursor: default;
    opacity: 0.5;
}

.phase-action-btn {
    background: var(--accent);
    color: var(--accent-foreground);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.03em;
    font-family: var(--font-body);
}

.phase-action-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.phase-action-btn.primary {
    background: var(--accent);
}

.phase-action-btn.primary:hover {
    background: var(--accent-secondary);
}

/* Phase requirements */
.phase-requirements-section {
    margin-bottom: 16px;
    padding: 20px;
    background: var(--muted);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.phase-requirements-section h5 {
    margin: 0 0 12px 0;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 400;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.requirement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.requirement-item.completed {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.requirement-item.completed .requirement-status {
    color: var(--accent);
    font-weight: 600;
}

.requirement-item:hover {
    box-shadow: var(--shadow-sm);
}

.requirement-name {
    font-size: 0.8125rem;
    color: var(--foreground);
}

.requirement-progress {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

.requirement-status {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.phase-time-info {
    padding: 10px;
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.phase-time-info p {
    margin: 5px 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

/* ============================================
   11. AI Assistant
   ============================================ */

.ai-assistant-main {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    height: fit-content;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.ai-assistant-main:hover {
    box-shadow: var(--shadow-md);
}

.ai-assistant {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.ai-assistant-header h3 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.action-btn {
    background: var(--muted);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--foreground);
    font-family: var(--font-body);
    letter-spacing: 0.02em;
    min-height: 44px;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 200ms ease-out;
}

.action-btn:hover::before {
    transform: scaleY(1);
}

.action-btn:hover {
    background: var(--card);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.action-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.action-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Chat */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    background: var(--muted);
    min-height: 400px;
    max-height: 500px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    word-wrap: break-word;
    line-height: 1.6;
}

.message.user .message-bubble {
    background: var(--accent);
    color: var(--accent-foreground);
    box-shadow: var(--shadow-sm);
}

.message.ai .message-bubble {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--foreground);
    line-height: 1.75;
    box-shadow: var(--shadow-sm);
}

/* Markdown in messages */
.message.ai .message-bubble h1 {
    font-family: var(--font-display);
    font-size: 1.3em;
    font-weight: 400;
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    color: var(--foreground);
    line-height: 1.3;
}

.message.ai .message-bubble h2 {
    font-family: var(--font-display);
    font-size: 1.15em;
    font-weight: 400;
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    color: var(--foreground);
    line-height: 1.3;
}

.message.ai .message-bubble h3 {
    font-family: var(--font-display);
    font-size: 1.05em;
    font-weight: 500;
    margin: 12px 0 4px;
    color: var(--foreground);
    line-height: 1.4;
}

.message.ai .message-bubble h4 {
    font-size: 0.95em;
    font-weight: 600;
    margin: 10px 0 4px;
    color: var(--muted-foreground);
}

.message.ai .message-bubble p {
    margin: 6px 0;
}

.message.ai .message-bubble ul,
.message.ai .message-bubble ol {
    margin: 6px 0;
    padding-left: 20px;
}

.message.ai .message-bubble li {
    margin: 3px 0;
    line-height: 1.6;
}

.message.ai .message-bubble li.level-0 {
    list-style-type: disc;
}

.message.ai .message-bubble li.level-1 {
    list-style-type: circle;
    margin-left: 16px;
}

.message.ai .message-bubble li.level-2 {
    list-style-type: square;
    margin-left: 32px;
}

.message.ai .message-bubble li.ordered-item {
    list-style-type: decimal;
}

.message.ai .message-bubble blockquote {
    margin: 8px 0;
    padding: 10px 14px;
    border-left: 2px solid var(--accent);
    background: var(--accent-muted);
    color: var(--muted-foreground);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.message.ai .message-bubble pre.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 8px 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.message.ai .message-bubble pre.code-block code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    background: none;
    padding: 0;
    color: inherit;
}

.message.ai .message-bubble code.inline-code {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
}

.message.ai .message-bubble a,
a.chat-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    border-bottom: none;
    cursor: pointer;
    transition: color 200ms ease-out;
    word-break: break-all;
}

.message.ai .message-bubble a:hover,
a.chat-link:hover {
    color: var(--foreground);
}

.message.ai .message-bubble a:visited,
a.chat-link:visited {
    color: var(--accent-secondary);
}

a.chat-link::after,
.message.ai .message-bubble a[href^="http"]::after {
    content: ' ↗';
    font-size: 0.75em;
    vertical-align: super;
    opacity: 0.7;
    text-decoration: none;
}

a.chat-link:hover::after,
.message.ai .message-bubble a[href^="http"]:hover::after {
    opacity: 1;
}

.message.ai .message-bubble hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.message.ai .message-bubble img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 8px 0;
}

.message.ai .message-bubble strong {
    font-weight: 600;
    color: var(--foreground);
}

.message.ai .message-bubble em {
    font-style: italic;
}

/* Streaming */
.message.ai .message-bubble.streaming {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.1);
}

.message.ai .message-bubble.streaming::after {
    content: '▊';
    animation: blink 1s infinite;
    color: var(--accent);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Thinking tag */
.thinking-tag {
    background: var(--accent-muted);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 0.875rem;
    color: var(--accent);
    cursor: pointer;
    transition: var(--transition);
}

.thinking-tag:hover {
    background: rgba(184, 134, 11, 0.1);
}

.thinking-tag.collapsed::after {
    content: ' ▼';
}

.thinking-tag.expanded::after {
    content: ' ▲';
}

.thinking-content {
    background: rgba(184, 134, 11, 0.03);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-top: 5px;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    border-left: 2px solid var(--accent);
}

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

/* Chat input */
.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    background: transparent;
    color: var(--foreground);
    font-family: var(--font-body);
}

#chat-input::placeholder {
    color: var(--muted-foreground);
    opacity: 0.6;
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.send-btn {
    background: var(--accent);
    color: var(--accent-foreground);
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.05em;
    font-family: var(--font-body);
    min-height: 44px;
    touch-action: manipulation;
}

.send-btn:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    background: var(--muted-foreground);
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* ============================================
   12. Mindmap
   ============================================ */

.mindmap-visualization {
    width: 100%;
    height: 500px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--muted);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mindmap-svg {
    width: 100%;
    height: 100%;
    background: transparent;
}

.mindmap-svg #connections {
    z-index: 1;
}

.mindmap-svg #nodes {
    z-index: 2;
}

.mindmap-node {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    position: relative;
    z-index: 10;
    background-clip: padding-box;
    font-family: var(--font-body);
}

.mindmap-node:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    z-index: 10;
}

.mindmap-node.root {
    background: var(--accent);
    color: var(--accent-foreground);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 10px 16px;
    max-width: 150px;
    border-radius: var(--radius-md);
    z-index: 15;
    box-shadow: var(--shadow-sm);
    border-color: var(--accent);
}

.mindmap-node.level-1 {
    background: var(--card);
    border-color: var(--accent);
    font-weight: 500;
    max-width: 100px;
    z-index: 12;
}

.mindmap-node.level-2 {
    background: var(--card);
    border-color: var(--border);
    font-size: 0.75rem;
    padding: 6px 10px;
    max-width: 90px;
    z-index: 11;
    margin: 2px;
}

.mindmap-connection {
    position: absolute;
    height: 1px;
    background: var(--accent);
    opacity: 0.4;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   13. Resources
   ============================================ */

.resources-container {
    margin: 10px 0;
    padding: 16px;
    background: var(--muted);
    border-radius: var(--radius-md);
    border-left: 2px solid var(--accent);
}

.resources-container h3 {
    margin: 0 0 12px 0;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.3;
}

.resource-item {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.resource-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-hover);
}

.resource-item:last-child {
    margin-bottom: 0;
}

.resource-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.resource-number {
    color: var(--accent);
    font-weight: 600;
    margin-right: 8px;
    font-size: 0.875rem;
    font-family: var(--font-display);
}

.resource-title {
    color: var(--foreground);
    font-size: 0.875rem;
    margin-right: 8px;
    flex: 1;
}

.resource-type {
    color: var(--muted-foreground);
    font-size: 0.6875rem;
    background: var(--muted);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.resource-description {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.resource-link {
    text-align: left;
}

.clickable-resource-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent) !important;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 6px 12px;
    background: var(--accent-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.clickable-resource-link:hover {
    background: var(--accent);
    color: var(--accent-foreground) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.clickable-resource-link:active {
    transform: translateY(0);
}

.resource-url-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.6875rem;
    color: var(--muted-foreground);
    word-break: break-all;
    line-height: 1.3;
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    opacity: 0.7;
}

.resource-url-hint:hover {
    color: var(--foreground);
}

/* ============================================
   14. Mindmap Content
   ============================================ */

.mindmap-content {
    padding: 20px;
}

.mindmap-content h3 {
    text-align: center;
    margin-bottom: 20px;
    font-family: var(--font-display);
    color: var(--foreground);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.2;
}

.mindmap-text {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    line-height: 1.75;
}

/* ============================================
   15. Modal
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.4);
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card);
    margin: 5% auto;
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--border);
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--foreground);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.close {
    color: var(--muted-foreground);
    float: right;
    font-size: 1.5rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close:hover {
    color: var(--foreground);
}

.mindmap-container {
    margin-top: 20px;
    min-height: 400px;
    background: var(--muted);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
}

/* ============================================
   16. Toast Notifications (Serif Style)
   ============================================ */

.toast {
    position: fixed;
    z-index: 10000;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-width: 360px;
    letter-spacing: 0.02em;
}

.toast-progress {
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--accent);
}

.toast-hint {
    top: 20px;
    left: 20px;
    background: var(--card);
    color: var(--foreground);
    white-space: pre-line;
}

.toast-phase-advance {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--accent);
    font-size: 1rem;
    padding: 20px 30px;
    text-align: center;
}

/* ============================================
   17. Animations
   ============================================ */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Toast animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

@keyframes phaseAdvanceIn {
    from {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes phaseAdvanceOut {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
}

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

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

/* Main content animation */
.main-content {
    animation: fadeIn 0.6s ease-out;
}

/* Dashboard section */
#dashboard-section {
    background: transparent;
    min-height: auto;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

/* ============================================
   18. Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .main-dashboard {
        grid-template-columns: 300px 1fr;
        gap: 16px;
    }

    .phases-sidebar {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .hero-section {
        min-height: auto;
        padding: 40px 16px;
        border-radius: var(--radius-md);
    }

    .hero-title {
        font-size: 2.2em;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .hero-features {
        gap: 6px;
        margin-bottom: 28px;
    }

    .hero-feature-item {
        padding: 8px 10px;
        min-width: 60px;
    }

    .hero-feature-icon {
        font-size: 1.2em;
    }

    .hero-feature-text {
        font-size: 0.6875rem;
    }

    .hero-feature-arrow {
        font-size: 0.9em;
    }

    .hero-input-card {
        padding: 24px 20px;
        border-radius: var(--radius-md);
    }

    .hero-trust {
        gap: 12px;
        margin-top: 20px;
    }

    .hero-trust-item {
        font-size: 0.75rem;
    }

    .header {
        flex-direction: column;
        gap: 4px;
        padding: 12px 16px;
    }

    .progress-content {
        flex-direction: column;
        gap: 16px;
    }

    .progress-ring {
        width: 120px;
        height: 120px;
    }

    .stats-info {
        flex-direction: column;
        gap: 12px;
        min-width: auto;
    }

    .main-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .phases-sidebar {
        min-height: auto;
        order: 2;
    }

    .ai-assistant-main {
        order: 1;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .model-selector {
        justify-content: space-between;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .mindmap-visualization {
        height: 350px;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75em;
    }

    .hero-subtitle {
        font-size: 0.875rem;
    }

    .hero-features {
        gap: 4px;
    }

    .hero-feature-item {
        padding: 6px 8px;
        min-width: 50px;
    }

    .hero-feature-text {
        font-size: 0.625rem;
    }

    .hero-input-card {
        padding: 20px 16px;
    }

    .progress-overview {
        padding: 16px;
    }

    .progress-overview h2 {
        font-size: 1.25rem;
    }

    .stat-item h3 {
        font-size: 0.9rem;
    }

    .stat-item p {
        font-size: 0.8125rem;
    }

    .phase-card {
        padding: 12px;
    }

    .message-bubble {
        max-width: 90%;
    }
}

/* ============================================
   19. Print Styles
   ============================================ */

@media print {
    body::before,
    body::after {
        display: none;
    }

    .header,
    .control-panel,
    .chat-input-area,
    .quick-actions {
        display: none;
    }

    .main-dashboard {
        grid-template-columns: 1fr;
    }

    .message-bubble {
        break-inside: avoid;
    }
}

/* ============================================
   20. Accessibility Enhancements
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #999999;
        --muted-foreground: #333333;
    }
}

/* Selection color */
::selection {
    background: var(--accent);
    color: var(--accent-foreground);
}

/* ============================================
   21. Utility Classes
   ============================================ */

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

.text-accent {
    color: var(--accent);
}

.text-muted {
    color: var(--muted-foreground);
}

.font-display {
    font-family: var(--font-display);
}

.font-body {
    font-family: var(--font-body);
}

.font-mono {
    font-family: var(--font-mono);
}