:root,
html[data-site-theme="light"] {
    --bg-dark: #eef5ff;
    --accent-blue: #2563eb;
    --accent-blue-strong: #1d4ed8;
    --ice-cyan: #0ea5e9;
    --text-main: #0f172a;
    --text-muted: #5f6f85;
    --glass-bg: rgba(255, 255, 255, 0.74);
    --glass-border: rgba(255, 255, 255, 0.92);
    --shadow-soft: 0 24px 60px rgba(37, 99, 235, 0.08);
    --border-soft: rgba(148, 163, 184, 0.22);
    --bg-elevated: #ffffff;
    --bg-soft: rgba(248, 251, 255, 0.92);
    --input-bg: rgba(255, 255, 255, 0.72);
    --paper-shadow: 0 25px 80px rgba(15, 23, 42, 0.08);
    --sphere-1: rgba(37, 99, 235, 0.34);
    --sphere-2: rgba(14, 165, 233, 0.24);
    --overlay-opacity: 0.12;
}

html[data-site-theme="dark"] {
    --bg-dark: #04111f;
    --accent-blue: #60a5fa;
    --accent-blue-strong: #93c5fd;
    --ice-cyan: #22d3ee;
    --text-main: #e5eefb;
    --text-muted: #95a6c3;
    --icon-bright: #f8fbff;
    --glass-bg: rgba(8, 19, 37, 0.68);
    --glass-border: rgba(148, 163, 184, 0.16);
    --shadow-soft: 0 30px 80px rgba(2, 8, 23, 0.5);
    --border-soft: rgba(148, 163, 184, 0.14);
    --bg-elevated: #0c1728;
    --bg-soft: rgba(15, 23, 42, 0.94);
    --input-bg: rgba(15, 23, 42, 0.82);
    --paper-shadow: 0 35px 90px rgba(2, 8, 23, 0.6);
    --sphere-1: rgba(37, 99, 235, 0.28);
    --sphere-2: rgba(34, 211, 238, 0.18);
    --overlay-opacity: 0.18;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background 0.35s ease, color 0.35s ease;
}

/* Background Effects */
.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    /* Changed from -1 to 0 to be above scroll-content if needed, but below prose-wrapper */
    opacity: 0.4;
    pointer-events: none;
}

.sphere-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-blue), transparent);
    top: -200px;
    right: -100px;
}

.sphere-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--ice-cyan), transparent);
    bottom: -100px;
    left: -100px;
}

.snow-overlay {
    position: absolute;
    inset: 0;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
    position: relative;
    z-index: 1;
    max-width: 100vw;
}

/* Config Panel */
.config-panel {
    width: 300px;
    min-width: 300px;
    border-radius: 24px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

/* Chat Panel */
/* Chat Panel */
.chat-panel {
    width: 380px;
    min-width: 380px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
}

@media (min-width: 1301px) {
    .chat-panel.hidden-desktop {
        width: 0;
        min-width: 0;
        margin-right: -40px;
        opacity: 0;
        pointer-events: none;
        border: none;
    }
}

@media (max-width: 1300px) {
    .chat-panel {
        position: fixed;
        right: 20px;
        top: 20px;
        bottom: 20px;
        z-index: 100;
        transform: translateX(120%);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

    .chat-panel.active {
        transform: translateX(0);
    }
}

.chat-panel .panel-header {
    padding: 24px 28px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 0;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-text h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.header-text .subtitle {
    font-size: 11px;
    margin-top: 2px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

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

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

.message {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 88%;
    position: relative;
    animation: messagePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message.system {
    align-self: stretch;
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-muted);
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-blue), var(--ice-cyan));
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.message.ai {
    align-self: flex-start;
    background: #fff;
    color: var(--text-main);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.chat-input-area {
    padding: 20px 24px 24px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #fff;
    padding: 8px 12px 8px 20px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.1);
}

.chat-input-area textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    resize: none;
    max-height: 120px;
}

.chat-input-area .send-btn {
    width: 38px;
    height: 38px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-input-area .send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    background: var(--ice-cyan);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.chat-input-area .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    opacity: 0.7;
}

.panel-header {
    margin-bottom: 30px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ice-cyan);
}

.subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 8px;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.config-form .form-group {
    margin-bottom: 24px;
}

.config-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.config-form textarea,
.config-form input,
.config-form select {
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.config-form textarea {
    height: 100px;
    resize: none;
}

.config-form input:focus,
.config-form textarea:focus,
.config-form select:focus {
    border-color: var(--accent-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.config-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 45px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-blue), var(--ice-cyan));
    border: none;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.panel-footer {
    margin-top: auto;
    padding-top: 20px;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--ice-cyan);
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
}

.status-indicator.busy .dot {
    background: #fbbf24;
    box-shadow: 0 0 10px #fbbf24;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

.actions .icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.actions .icon-btn:hover {
    background: var(--accent-blue);
    color: #fff;
}

/* Content Area Container (Transparent Scroll Layer) */
.viewer-container {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    position: relative;
    scrollbar-gutter: stable;
    background: transparent;
    border: none;
    box-shadow: none;
}

.scroll-content {
    position: relative;
    min-height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 100px;
    /* Give some space at the end */
}

/* The Integrated Breathing Canvas */
.prose-wrapper {
    display: block;
    width: 66.6%;
    max-width: 900px;
    margin: 40px auto;
    padding: 60px 40px;
    height: auto;
    min-height: 800px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow-wrap: break-word;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    /* Ensure paper is above background elements */
}

@media (max-width: 1024px) {
    .prose-wrapper {
        width: 90%;
        margin: 20px auto;
        padding: 40px 20px;
    }
}

/* WeChat Public Account Style (WeMD Inspired) */
.prose {
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
    line-height: 1.75;
    color: #353535;
    word-break: break-word;
    outline: none;
    /* 移除编辑时的外边框 */
    transition: background 0.3s;
}

.prose[contenteditable="true"]:focus {
    background: rgba(59, 130, 246, 0.01);
}

/* 局部更新时的“幽灵”容器 */
#output-ghost {
    display: none;
}

/* 基础排版重置：确保块级特性 */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6,
.prose p {
    display: block !important;
    clear: both;
    width: 100%;
}

.prose h2 {
    font-size: 1.4em;
    margin: 1.5em 0 1em;
    color: inherit;
}

.prose h3 {
    font-size: 1.2em;
    margin: 1.2em 0 0.8em;
    color: inherit;
}

.prose p {
    margin-bottom: 1em;
    line-height: inherit;
}

.prose blockquote {
    margin: 2rem 0;
    padding: 1.2rem 1.5rem;
    background: #f8fafc;
    border-left: 4px solid #cbd5e1;
    color: #475569;
    font-style: italic;
    border-radius: 0 12px 12px 0;
}

.prose ul,
.prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose strong {
    color: var(--accent-blue);
    font-weight: 600;
}

.prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2.5rem auto;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.prose hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, transparent, #cbd5e1, transparent);
    margin: 3rem 0;
}


.placeholder-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-view h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Cursor Animation */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--ice-cyan);
    margin-left: 2px;
    animation: cursor-blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes cursor-blink {
    50% {
        opacity: 0;
    }
}

/* Custom Scrollbar */
.viewer-container::-webkit-scrollbar {
    width: 6px;
}

.viewer-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Agent Process Steps */
.agent-step {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.agent-step.active {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

.agent-step-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.8);
}

.agent-step-header .icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    font-size: 14px;
}

.agent-step-header .title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.agent-step-header .status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-step-header .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fbbf24;
}

.agent-step.completed .status-dot {
    background: #4ade80;
}

.agent-step.completed .status-icon {
    color: #4ade80;
    font-size: 12px;
}

.agent-step-header .chevron {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.agent-step.collapsed .agent-step-content {
    display: none !important;
}

.agent-step.collapsed .chevron {
    transform: rotate(-90deg);
}

.agent-step-content {
    padding: 15px 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

.agent-step-content .requirement-item {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.agent-step-content .requirement-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.agent-step-content .preview-text {
    max-height: 120px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 11px;
    white-space: pre-wrap;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.agent-step-content .meta-field {
    margin-bottom: 12px;
}

.agent-step-content .meta-label {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.agent-step-content .meta-value {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.02);
    color: var(--text-main);
}

/* 呼吸灯效果 */
@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(251, 191, 36, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

.agent-step.active .status-dot {
    animation: pulse-orange 2s infinite;
}

/* Theme Panel Styles */
.theme-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.panel-section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.panel-section-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: translateX(-3px);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    padding-right: 5px;
    flex-grow: 1;
}

.theme-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.theme-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-card.active {
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}

.theme-preview-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-blue), var(--ice-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.theme-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 38%),
        radial-gradient(circle at 85% 15%, rgba(125, 211, 252, 0.22), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}

html[data-site-theme="dark"] body::before {
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(34, 211, 238, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0));
}

.sphere-1 {
    background: radial-gradient(circle, var(--sphere-1), transparent 68%);
}

.sphere-2 {
    background: radial-gradient(circle, var(--sphere-2), transparent 68%);
}

.snow-overlay {
    opacity: var(--overlay-opacity);
}

.config-panel,
.chat-panel {
    border-radius: 30px;
}

.chat-panel .panel-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    border-bottom: 1px solid var(--border-soft);
}

html[data-site-theme="dark"] .chat-panel .panel-header {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(15, 23, 42, 0));
}

.message.system {
    background: rgba(148, 163, 184, 0.14);
}

.message.ai,
.agent-step,
.theme-card.active,
.prose-wrapper {
    background: var(--bg-elevated);
    border-color: var(--border-soft);
}

.message.ai,
.agent-step {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.chat-input-area {
    background: rgba(255, 255, 255, 0.32);
    border-top: 1px solid var(--border-soft);
}

html[data-site-theme="dark"] .chat-input-area {
    background: rgba(2, 8, 23, 0.18);
}

.input-wrapper,
.config-form textarea,
.config-form input,
.config-form select {
    background: var(--input-bg);
    border-color: var(--border-soft);
}

.config-form input:focus,
.config-form textarea:focus,
.config-form select:focus {
    background: var(--bg-elevated);
}

.actions {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    width: auto !important;
    min-width: 116px;
    padding: 0 14px;
    gap: 8px;
}

.theme-toggle-btn::after {
    content: attr(data-theme-label);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.prose-wrapper {
    border-radius: 28px;
    box-shadow: var(--paper-shadow);
}

.prose {
    color: #334155;
}

html[data-site-theme="dark"] .prose {
    color: #d6e0ee;
}

html[data-site-theme="dark"] .prose blockquote {
    background: rgba(15, 23, 42, 0.74);
    border-left-color: rgba(96, 165, 250, 0.6);
    color: #bfd0e7;
}

html[data-site-theme="dark"] .prose hr {
    background-image: linear-gradient(to right, transparent, rgba(148, 163, 184, 0.5), transparent);
}

html[data-site-theme="dark"] .logo i,
html[data-site-theme="dark"] .back-link i,
html[data-site-theme="dark"] .header-main > i,
html[data-site-theme="dark"] .placeholder-view i,
html[data-site-theme="dark"] .panel-section-title i,
html[data-site-theme="dark"] .theme-card i,
html[data-site-theme="dark"] .theme-toggle-btn i,
html[data-site-theme="dark"] .chat-input-area .send-btn i,
html[data-site-theme="dark"] .actions .icon-btn i {
    color: var(--icon-bright);
}

html[data-site-theme="dark"] .actions .icon-btn {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.35);
}

html[data-site-theme="dark"] .actions .icon-btn:hover,
html[data-site-theme="dark"] .theme-toggle-btn:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--ice-cyan));
    border-color: transparent;
}

.agent-step-header,
.theme-card {
    background: rgba(255, 255, 255, 0.34);
}

.agent-step-content,
.chat-panel .panel-header,
.agent-step,
.theme-card.active,
.input-wrapper,
.config-form textarea,
.config-form input,
.config-form select,
.prose-wrapper {
    border-color: var(--border-soft);
}

.agent-step-content .preview-text,
.agent-step-content .meta-value {
    background: var(--bg-soft);
    border-color: var(--border-soft);
}

html[data-site-theme="dark"] .agent-step-header,
html[data-site-theme="dark"] .theme-card {
    background: rgba(15, 23, 42, 0.42);
}

html[data-site-theme="dark"] .theme-card:hover {
    background: rgba(15, 23, 42, 0.62);
}

html[data-site-theme="dark"] .config-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2395a6c3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

@media (max-width: 1024px) {
    .theme-toggle-btn {
        min-width: 40px;
        padding: 0;
    }

    .theme-toggle-btn::after {
        display: none;
    }
}
