@font-face {
    font-family: "WanYuanTi";
    src: url("fonts/WanYuanTi.woff2") format("woff2"),
         url("fonts/WanYuanTi.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #ff6b9d;
    --primary-light: #ffb5cc;
    --primary-dark: #e8527f;
    --secondary: #b4a0e5;
    --secondary-light: #d4c7f0;
    --accent: #67e8f9;
    --mint: #7dcea0;
    --warm: #ffd93d;
    --danger: #ff6b6b;
    --orange: #ff9a3c;
    --orange-light: #ffb86c;
    --bg: #fff5f7;
    --card: rgba(255, 255, 255, 0.92);
    --card-solid: #ffffff;
    --card-hover: rgba(255, 255, 255, 0.98);
    --text: #4a4a6a;
    --text-light: #9898b8;
    --border: #f0e0e8;
    --shadow: 0 4px 24px rgba(255, 107, 157, 0.12);
    --shadow-hover: 0 8px 32px rgba(255, 107, 157, 0.2);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --font-cute: "WanYuanTi", "ZCOOL KuaiLe", cursive;
    --font-body: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-w: 300px;
    --header-h: 74px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

button,
input,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

#bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 35%),
        linear-gradient(135deg, rgba(255, 181, 204, 0.4), rgba(180, 160, 229, 0.24)),
        var(--bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.4s ease;
}

#bg-layer.has-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 250, 248, 0.3);
}

#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    opacity: 0;
    font-size: 16px;
    animation: floatUp 7s ease-in infinite;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(100vh) rotate(0deg);
    }
    15% {
        opacity: 0.75;
    }
    85% {
        opacity: 0.75;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) rotate(360deg);
    }
}

#header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: var(--header-h);
    padding: 0 28px;
    background: linear-gradient(135deg, rgba(255, 154, 60, 0.95), rgba(255, 184, 108, 0.95));
    backdrop-filter: blur(14px);
    box-shadow: 0 2px 20px rgba(255, 154, 60, 0.28);
}

.site-title {
    color: #fff;
    font-size: 28px;
    font-family: var(--font-cute);
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.subtitle {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.34);
    transform: translateY(-1px);
}

.main-layout {
    display: flex;
    min-height: calc(100vh - var(--header-h));
}

#sidebar {
    position: sticky;
    top: var(--header-h);
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    padding: 20px 16px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--card);
    backdrop-filter: blur(10px);
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section h3 {
    color: var(--primary);
    font-size: 16px;
    font-family: var(--font-cute);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px dashed var(--primary-light);
}

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

.section-header-row h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.mini-action-btn {
    border: 1px solid var(--primary-light);
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-action-btn:hover {
    background: var(--bg);
}

.progress-ring-container {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

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

.progress-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
    fill: var(--primary);
    font-size: 21px;
    text-anchor: middle;
    font-family: var(--font-cute);
}

.progress-ring-sub {
    fill: var(--text-light);
    font-size: 11px;
    text-anchor: middle;
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat {
    white-space: nowrap;
    border-radius: 999px;
    background: var(--bg);
    padding: 4px 10px;
    font-size: 12px;
}

.day-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-btn {
    position: relative;
    width: 100%;
    text-align: left;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.day-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.26);
}

.day-btn-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.day-title-group {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-num {
    font-size: 16px;
    font-family: var(--font-cute);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.day-btn.active .day-meta,
.day-btn.active .category-count {
    color: rgba(255, 255, 255, 0.88);
}

.category-count {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-light);
    font-size: 11px;
}

.day-edit-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-light);
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.day-edit-btn:hover {
    background: var(--bg);
    transform: translateY(-1px);
}

.day-btn.active .day-edit-btn {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.inline-form-card {
    margin-bottom: 12px;
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 14px;
}

.inline-form-card label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-light);
}

.inline-form-card input,
.inline-form-card select,
.inline-form-card textarea,
.settings-group input,
.settings-group select,
.settings-group textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inline-form-card input:focus,
.inline-form-card select:focus,
.inline-form-card textarea:focus,
.settings-group input:focus,
.settings-group select:focus,
.settings-group textarea:focus,
.problem-code:focus,
.ai-question-input:focus,
.insight-editor input:focus,
.insight-editor textarea:focus,
.method-inputs textarea:focus,
.method-inputs input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.inline-form-card textarea {
    resize: vertical;
    min-height: 90px;
}

.inline-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

#main-content {
    flex: 1;
    padding: 24px 32px;
    width: 100%;
    max-width: none;
    min-width: 0;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    background: transparent;
    color: var(--text-light);
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-cute);
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab:hover {
    background: rgba(255, 107, 157, 0.08);
    color: var(--text);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 3px 12px rgba(255, 107, 157, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.28s ease;
}

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

.day-header,
.empty-panel,
.method-board,
.wrong-board {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.day-header {
    margin-bottom: 18px;
    padding: 24px;
    border-left: 5px solid var(--primary);
}

.day-header h2 {
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 24px;
    font-family: var(--font-cute);
}

.day-goal {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.problem-catalog {
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--secondary);
}

.problem-catalog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.problem-catalog-head h3 {
    margin-bottom: 5px;
    color: var(--secondary);
    font-size: 17px;
    font-family: var(--font-cute);
}

.problem-catalog-head p {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.6;
}

.problem-catalog-count {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f3ebff;
    color: var(--secondary);
    font-size: 12px;
}

.problem-catalog-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.problem-catalog-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.problem-catalog-item:hover {
    border-color: var(--primary-light);
    background: var(--bg);
    transform: translateY(-1px);
}

.catalog-index {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 12px;
    font-family: var(--font-cute);
}

.catalog-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-mark {
    flex-shrink: 0;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
}

.catalog-mark-ai {
    background: #f3ebff;
    color: var(--secondary);
}

.catalog-mark-wrong {
    background: #fff0f0;
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    border-radius: var(--radius-xs);
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.35);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-accent {
    background: var(--accent);
    color: #163641;
}

.btn-warm {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #fff;
}

.btn-danger {
    background: #fff0f0;
    color: var(--danger);
    border: 1px solid #ffd0d0;
}

.btn-ghost {
    background: #fff;
    color: var(--text-light);
    border: 1px dashed var(--border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn.is-loading,
.diagnose-btn.is-loading {
    cursor: wait;
    opacity: 0.85;
}

.problem-form-card {
    margin-bottom: 18px;
    border: 2px dashed var(--orange-light);
}

.form-title {
    margin-bottom: 12px;
    color: var(--orange);
    font-size: 16px;
    font-family: var(--font-cute);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.html-upload-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.form-hint {
    color: var(--text-light);
    font-size: 12px;
}

.html-source-input {
    min-height: 130px;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

.problem-card,
.method-card,
.wrong-card {
    margin-bottom: 14px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.problem-card {
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    scroll-margin-top: 94px;
}

.problem-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-hover);
}

.problem-card.is-wrong {
    border-left: 5px solid var(--danger);
}

.problem-card.is-collapsed {
    padding-bottom: 16px;
}

.problem-card.is-collapsed .problem-fold-body {
    display: none;
}

.problem-highlight {
    animation: problemPulse 1.4s ease;
}

@keyframes problemPulse {
    0%, 100% {
        box-shadow: var(--shadow);
        border-color: transparent;
    }
    25%, 70% {
        box-shadow: 0 0 0 4px var(--warm), var(--shadow-hover);
        border-color: var(--warm);
    }
}

.problem-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.problem-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.problem-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.problem-title {
    color: var(--primary);
    font-size: 18px;
    font-family: var(--font-cute);
}

.problem-link {
    color: var(--secondary);
    text-decoration: none;
}

.problem-link:hover {
    text-decoration: underline;
}

.problem-desc {
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    background: var(--bg);
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.problem-source-details {
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.68);
}

.problem-source-details summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.problem-html-preview {
    max-height: 220px;
    margin-top: 8px;
    padding: 12px;
    overflow: auto;
    border-radius: var(--radius-xs);
    background: #f7f2f7;
    color: var(--text-light);
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-ai {
    background: #f3ebff;
    color: var(--secondary);
}

.badge-chat {
    background: #e9fbff;
    color: #16859a;
}

.badge-insight {
    background: #fff3df;
    color: var(--orange);
}

.badge-source {
    background: #fff6db;
    color: #b06a00;
}

.badge-wrong {
    background: #fff0f0;
    color: var(--danger);
}

.problem-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.problem-code-wrap {
    margin-top: 12px;
}

.ai-question-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(233, 251, 255, 0.72));
}

.insight-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 184, 108, 0.42);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(255, 250, 238, 0.92), rgba(255, 246, 251, 0.82));
}

.insight-box-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.insight-box-head strong {
    color: var(--orange);
    font-family: var(--font-cute);
    font-size: 16px;
}

.insight-box-head p {
    margin-top: 4px;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.6;
}

.insight-editor {
    display: grid;
    gap: 10px;
}

.insight-editor input,
.insight-editor textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.insight-editor textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.7;
}

.insight-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.insight-history {
    margin-top: 14px;
}

.field-caption {
    display: block;
    margin-bottom: 6px;
    color: var(--text-light);
    font-size: 12px;
}

.problem-code,
.ai-question-input,
.method-inputs textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    color: var(--text);
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.ai-question-input {
    min-height: 92px;
    font-family: var(--font-body);
}

.ai-question-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.chat-history {
    margin-top: 14px;
}

.chat-question {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-xs);
    background: var(--bg);
    line-height: 1.7;
}

.chat-question strong {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-dark);
}

.chat-question p {
    white-space: pre-wrap;
}

.problem-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.problem-meta {
    color: var(--text-light);
    font-size: 12px;
}

.problem-primary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.diagnose-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.accordion-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    padding: 14px 16px;
}

.accordion-header:hover {
    background: rgba(255, 107, 157, 0.05);
}

.accordion-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.accordion-title strong {
    color: var(--text);
    font-size: 14px;
}

.accordion-title span {
    color: var(--text-light);
    font-size: 12px;
}

.accordion-caret {
    color: var(--text-light);
    font-size: 12px;
}

.accordion-body {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px dashed var(--border);
    min-width: 0;
    overflow: visible;
}

.accordion-item.open .accordion-body {
    display: block;
}

.analysis-content,
.method-content {
    margin-top: 12px;
    line-height: 1.8;
    font-size: 14px;
    width: 100%;
    min-width: 0;
    overflow: visible;
    word-break: break-word;
}

.analysis-content h1,
.analysis-content h2,
.analysis-content h3,
.method-content h1,
.method-content h2,
.method-content h3 {
    margin: 12px 0 6px;
    color: var(--primary-dark);
    font-family: var(--font-cute);
}

.analysis-content pre,
.analysis-content code,
.method-content pre,
.method-content code {
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

.analysis-content pre,
.method-content pre {
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    margin: 10px 0;
    padding: 12px;
    border-radius: var(--radius-xs);
    background: #f5f2fb;
    white-space: pre;
}

.analysis-content pre code,
.method-content pre code {
    display: block;
    width: max-content;
    min-width: 100%;
    padding: 0;
    background: transparent;
    white-space: pre;
}

.analysis-content code,
.method-content code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #f5f2fb;
    white-space: pre-wrap;
    word-break: break-word;
}

.analysis-content p,
.analysis-content li,
.method-content p,
.method-content li {
    overflow-wrap: anywhere;
}

.analysis-content ul,
.analysis-content ol,
.method-content ul,
.method-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.analysis-content blockquote,
.method-content blockquote {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 3px solid var(--primary-light);
    color: var(--text-light);
}

.analysis-empty,
.empty-panel {
    padding: 26px 24px;
    color: var(--text-light);
}

.empty-panel {
    text-align: center;
}

.analysis-toolbar,
.method-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.method-board,
.wrong-board {
    padding: 20px;
}

.method-board-header,
.wrong-board-header {
    margin-bottom: 16px;
}

.method-board-header h2,
.wrong-board-header h2 {
    color: var(--secondary);
    font-family: var(--font-cute);
    font-size: 22px;
}

.wrong-board-header h2 {
    color: var(--danger);
}

.method-board-header p,
.wrong-board-header p {
    margin-top: 6px;
    color: var(--text-light);
    font-size: 14px;
}

.method-inputs {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 245, 247, 0.9));
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.method-inputs input {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
}

.method-inputs textarea {
    min-height: 140px;
    font-family: var(--font-body);
}

.method-card {
    padding: 16px 18px;
    border-left: 4px solid var(--warm);
}

.method-card-head,
.wrong-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.method-card h3,
.wrong-card h3 {
    color: var(--orange);
    font-size: 18px;
    font-family: var(--font-cute);
}

.method-meta,
.wrong-meta {
    color: var(--text-light);
    font-size: 12px;
}

.wrong-card {
    padding: 18px;
    border-left: 5px solid var(--danger);
}

.wrong-card .problem-desc {
    margin-top: 10px;
}

.wrong-records {
    margin-top: 12px;
}

.music-section iframe {
    width: 100%;
    border-radius: var(--radius-xs);
}

.empty-hint {
    padding: 16px 0;
    color: var(--text-light);
    text-align: center;
    font-size: 13px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(74, 74, 106, 0.42);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: min(92vw, 620px);
    max-height: 88vh;
    overflow-y: auto;
    border-radius: var(--radius);
    background: var(--card-solid);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.25s ease;
}

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

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

.modal-header h2 {
    color: var(--primary);
    font-size: 20px;
    font-family: var(--font-cute);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    font-size: 20px;
}

.modal-body {
    padding: 20px 24px 24px;
}

.settings-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border);
}

.settings-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-group h3 {
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 16px;
    font-family: var(--font-cute);
}

.settings-group label {
    display: block;
    margin: 10px 0 4px;
    color: var(--text-light);
    font-size: 12px;
}

.settings-group select {
    appearance: none;
}

.settings-tip {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.7;
}

.bg-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.bg-preview-item {
    position: relative;
    width: 88px;
    height: 62px;
    border: 3px solid transparent;
    border-radius: var(--radius-xs);
    overflow: hidden;
    cursor: pointer;
}

.bg-preview-item.active {
    border-color: var(--primary);
}

.bg-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-preview-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.92);
    color: #fff;
    cursor: pointer;
}

.music-add-row,
.data-actions,
.bg-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.music-add-row input {
    flex: 1;
}

.music-manage-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.music-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    background: var(--bg);
    font-size: 13px;
}

.bg-view-exit {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 210;
    display: none;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 12px 24px;
    font-size: 14px;
    font-family: var(--font-cute);
    cursor: pointer;
}

body.bg-viewing #app,
body.bg-viewing #particles {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.bg-viewing #bg-layer.has-bg::after {
    background: transparent;
}

body.bg-viewing .bg-view-exit {
    display: block;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--primary-light);
}

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

    #sidebar {
        position: relative;
        top: 0;
        width: 100%;
        min-width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #main-content {
        padding: 16px;
    }

    .day-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #header {
        height: auto;
        padding: 14px 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .site-title {
        font-size: 22px;
    }

    .header-right {
        width: 100%;
    }

    .header-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .form-grid,
    .day-nav {
        grid-template-columns: 1fr;
    }

    .problem-top,
    .problem-action-row,
    .method-card-head,
    .wrong-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .problem-tools,
    .problem-primary-actions {
        justify-content: flex-start;
    }
}
