/* 3GPP培训材料生成器 - 样式 */
:root {
    --navy: #03045e;
    --blue: #0077b6;
    --cyan: #00b4d8;
    --light-cyan: #90e0ef;
    --pale: #caf0f8;
    --dark: #1a1a2e;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
}

.header h1 {
    font-size: 28px;
    color: var(--navy);
}

.subtitle {
    color: var(--gray);
    font-size: 14px;
}

/* Input */
.input-section {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--cyan);
}

.input-group button {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.input-group button:hover {
    opacity: 0.9;
}

.input-group button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.examples {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--gray);
    font-size: 13px;
}

.example-btn {
    padding: 5px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 20px;
    background: white;
    color: var(--blue);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-btn:hover {
    background: var(--pale);
    border-color: var(--cyan);
}

/* Progress */
.progress-section {
    margin-bottom: 30px;
}

.progress-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stage-indicator {
    display: flex;
    gap: 0;
    justify-content: center;
    margin-bottom: 6px;
}

.stage-dot {
    width: 36px;
    height: 6px;
    border-radius: 3px;
    background: var(--light-gray);
    transition: background 0.3s;
}

.stage-dot.active {
    background: var(--cyan);
}

.stage-dot.done {
    background: var(--blue);
}

.stage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 20px;
}

.progress-bar-container {
    height: 6px;
    background: var(--light-gray);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-message {
    text-align: center;
    color: var(--dark);
    font-size: 14px;
    margin-bottom: 12px;
}

.log-area {
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--light-gray);
    padding-top: 12px;
}

.log-entry {
    font-size: 12px;
    color: var(--gray);
    padding: 3px 0;
    font-family: "Cascadia Code", "Fira Code", monospace;
}

.log-entry.error {
    color: #e74c3c;
}

/* Result */
.result-section {
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.result-icon {
    font-size: 48px;
    color: var(--cyan);
    margin-bottom: 16px;
}

.result-card h2 {
    color: var(--navy);
    margin-bottom: 8px;
}

.result-card p {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 14px;
}

.download-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    transition: opacity 0.2s;
}

.download-btn:hover {
    opacity: 0.9;
}

/* Error */
.error-section {
    margin-bottom: 30px;
}

.error-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-left: 4px solid #e74c3c;
}

.error-icon {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 16px;
}

.error-card h2 {
    color: var(--dark);
    margin-bottom: 8px;
}

.error-card p {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 14px;
}

.retry-btn {
    padding: 10px 24px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 30px;
    color: var(--gray);
    font-size: 12px;
}

/* ── Settings Panel ── */
.settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--blue);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.settings-toggle:hover {
    color: var(--navy);
}

.settings-icon {
    font-size: 16px;
}

.settings-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.settings-panel {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.setting-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
    cursor: pointer;
}

.setting-desc {
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
    line-height: 1.5;
}

/* Theme swatches */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.theme-swatch:hover {
    border-color: var(--cyan);
}

.theme-swatch.active {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
}

.swatch-colors {
    display: flex;
    gap: 2px;
    width: 100%;
}

.swatch-color {
    flex: 1;
    height: 16px;
}

.swatch-color:first-child {
    border-radius: 3px 0 0 3px;
}

.swatch-color:last-child {
    border-radius: 0 3px 3px 0;
}

.swatch-name {
    font-size: 10px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Style options */
.style-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.style-btn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
}

.style-btn strong {
    font-size: 13px;
    color: var(--dark);
}

.style-btn span {
    font-size: 11px;
    color: var(--gray);
}

.style-btn:hover {
    border-color: var(--cyan);
}

.style-btn.active {
    border-color: var(--blue);
    background: var(--pale);
}

/* Language options */
.lang-options {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 6px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 6px;
    background: white;
    color: var(--dark);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lang-btn:hover {
    border-color: var(--cyan);
}

.lang-btn.active {
    border-color: var(--blue);
    background: var(--pale);
    color: var(--blue);
    font-weight: 600;
}

/* Examples */
.examples {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--gray);
    font-size: 13px;
    margin-top: 12px;
}

.example-btn {
    padding: 5px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 20px;
    background: white;
    color: var(--blue);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.example-btn:hover {
    background: var(--pale);
    border-color: var(--cyan);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stage indicator (5 dots) */
.stage-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
}

.stage-dot {
    width: 36px;
    height: 6px;
    border-radius: 3px;
    background: var(--light-gray);
    transition: background 0.3s;
}

.stage-dot.active {
    background: var(--cyan);
}

.stage-dot.done {
    background: var(--blue);
}

.stage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }

    .logo h1 {
        font-size: 22px;
    }

    .container {
        padding: 20px 16px;
    }

    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .style-options {
        grid-template-columns: 1fr;
    }
}
