/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(43, 111, 255, 0.18),
                    inset 0 0 0 0 rgba(43, 111, 255, 0.06);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(43, 111, 255, 0.06),
                    inset 0 0 0 1px rgba(43, 111, 255, 0.10);
    }
}

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

@keyframes floatSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

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

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

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

@keyframes borderGlow {
    0%, 100% { border-color: rgba(43, 111, 255, 0.14); }
    50% { border-color: rgba(43, 111, 255, 0.32); }
}

.fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fade-in-up--fast {
    animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

.float-soft {
    animation: floatSoft 4s ease-in-out infinite;
}

/* ========== DESIGN TOKENS ========== */
:root {
    --bg: #eef5ff;
    --bg-strong: #dceaff;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-solid: #ffffff;
    --line: rgba(98, 146, 235, 0.16);
    --line-strong: rgba(98, 146, 235, 0.28);
    --text: #0f2440;
    --text-soft: #4a6d96;
    --primary: #2563eb;
    --primary-deep: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-soft: rgba(37, 99, 235, 0.08);
    --primary-glow: rgba(37, 99, 235, 0.14);
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.10);
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 4px 16px rgba(15, 36, 64, 0.06);
    --shadow: 0 12px 40px rgba(15, 36, 64, 0.10);
    --shadow-lg: 0 24px 64px rgba(15, 36, 64, 0.14);
    --radius-sm: 16px;
    --radius: 24px;
    --radius-lg: 32px;
    --radius-full: 999px;
    --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== RESET ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(96, 165, 250, 0.20), transparent 40%),
        radial-gradient(ellipse 60% 50% at 80% 0%, rgba(37, 99, 235, 0.14), transparent 36%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(147, 197, 253, 0.16), transparent 36%),
        linear-gradient(180deg, #f6faff 0%, #eef5ff 40%, #e2eeff 100%);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ========== LAYOUT ========== */
.page-shell {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.layout {
    display: grid;
    gap: 24px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========== TOPBAR ========== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; font-weight: 700; }
.brand small { margin-top: 3px; color: var(--text-soft); font-size: 13px; }

.brand__mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1d4ed8 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.30);
    transition: transform var(--transition-spring);
}

.brand:hover .brand__mark {
    transform: scale(1.06);
}

.topbar__nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.topbar__nav a {
    padding: 9px 16px;
    border-radius: var(--radius-full);
    color: var(--text-soft);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.topbar__nav a:hover {
    color: var(--primary-deep);
    background: var(--primary-soft);
}

/* ========== HOME STUDIO ========== */
.home-studio {
    padding: 32px;
    background:
        radial-gradient(ellipse 60% 40% at 0% 0%, rgba(96, 165, 250, 0.14), transparent 30%),
        radial-gradient(ellipse 50% 30% at 100% 100%, rgba(37, 99, 235, 0.10), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(236, 244, 255, 0.92));
}

.studio-shell {
    display: grid;
    gap: 26px;
}

/* ========== STUDIO HEADER ========== */
.studio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.studio-header h1 {
    margin: 10px 0 0;
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #0f2440 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.studio-header p {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--text-soft);
    line-height: 1.8;
    font-size: 15px;
}

.studio-header__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    background: rgba(15, 36, 64, 0.05);
    color: var(--text-soft);
    transition: all var(--transition-fast);
}

.status-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: currentColor;
}

.status-dot--online {
    color: var(--success);
    background: var(--success-soft);
}

.status-dot--online::before {
    animation: pulseDot 2s ease-in-out infinite;
}

.status-dot--offline {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.10);
}

.workspace-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: var(--radius-full);
    color: var(--primary-deep);
    background: var(--primary-soft);
    border: 1px solid rgba(37, 99, 235, 0.16);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.workspace-link:hover {
    background: rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

/* ========== STUDIO MAIN (L/R LAYOUT) ========== */
.studio-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.88fr);
    gap: 26px;
    align-items: start;
}

/* ========== LEFT: COMPOSE CARD ========== */
.compose-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(96, 145, 236, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 248, 255, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.compose-card__head {
    margin-bottom: 24px;
}

.compose-card__head h2 {
    margin: 10px 0 0;
    font-size: 28px;
    line-height: 1.25;
}

.compose-card__head p {
    margin: 10px 0 0;
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 14px;
}

.compose-form {
    display: grid;
    gap: 20px;
}

/* ========== RIGHT: PREVIEW COLUMN ========== */
.preview-column {
    display: grid;
    gap: 18px;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric-card--mini {
    padding: 16px;
    border-radius: var(--radius-sm);
}

.metric-card--mini strong {
    font-size: 24px;
}

.metric-card--mini span {
    font-size: 12px;
    margin-top: 6px;
}

.control-tips--preview {
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.control-tips--preview strong {
    font-size: 15px;
}

.control-tips--preview p {
    font-size: 13px;
    margin-top: 8px;
}

.control-tips--preview code {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    font-weight: 700;
}

.platform-card--preview {
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.platform-card--preview strong {
    font-size: 15px;
}

.platform-card--preview p {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.7;
}

/* ========== PREVIEW CARD ========== */
.preview-card {
    padding: 22px;
    display: grid;
    gap: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(93, 145, 236, 0.18);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.preview-card--hero {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(233, 243, 255, 0.90));
}

.preview-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.preview-card__head h2 {
    margin: 10px 0 0;
    font-size: 26px;
    line-height: 1.2;
}

.preview-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.preview-badges span {
    padding: 8px 11px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary-deep);
    border: 1px solid rgba(37, 99, 235, 0.12);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ========== PREVIEW SCREEN ========== */
.preview-screen {
    position: relative;
    min-height: 340px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(88, 139, 234, 0.18);
    transition: all var(--transition-base);
}

.preview-screen:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.12);
}

.preview-screen::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 1;
}

.preview-screen img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: contain;
    background:
        linear-gradient(180deg, #f8fbff, #eef5ff);
}

.preview-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 28px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(21, 73, 182, 0.96), rgba(82, 157, 255, 0.84)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.preview-placeholder__icon {
    margin-bottom: 8px;
    animation: floatSoft 4s ease-in-out infinite;
}

.preview-placeholder strong {
    display: block;
    margin-top: 16px;
    font-size: 28px;
    letter-spacing: 3px;
    font-weight: 300;
}

.preview-placeholder p {
    max-width: 360px;
    margin: 12px auto 0;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
}

/* ========== PREVIEW META ========== */
.preview-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
}

.preview-meta__title strong {
    display: block;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
}

.preview-meta__title p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.preview-meta__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.preview-meta__chips span {
    padding: 7px 11px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ========== FORM ELEMENTS ========== */
.field {
    display: grid;
    gap: 9px;
}

.field--full {
    grid-column: 1 / -1;
}

.field span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(94, 145, 236, 0.18);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
    color: var(--text);
    outline: none;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.field textarea {
    resize: vertical;
    line-height: 1.7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08), var(--shadow-sm);
}

.field input::placeholder,
.field textarea::placeholder {
    color: #94a8c4;
}

/* ========== SETTING PANEL ========== */
.setting-panel {
    display: grid;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(95, 145, 236, 0.14);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.97), rgba(240, 247, 255, 0.97));
}

.setting-group {
    display: grid;
    gap: 10px;
}

.setting-group > span {
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.2px;
}

.option-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-pill {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.option-pill::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    transition: opacity var(--transition-fast);
}

.option-pill:hover {
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--primary-deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.10);
}

.option-pill:hover::after {
    opacity: 1;
}

.option-pill.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1d4ed8 100%);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
    animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== FORM ACTIONS ========== */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.form-actions--compose {
    padding-top: 8px;
}

.form-message--compose {
    max-width: 420px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    background-size: 200% 100%;
    transition: opacity var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:hover::after {
    opacity: 1;
    animation: shimmer 1.2s ease-in-out;
}

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

.btn:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1d4ed8 100%);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.30);
}

.btn--primary:hover {
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.38);
}

.btn--hero {
    min-height: 54px;
    padding: 0 32px;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.btn__icon {
    font-size: 18px;
    line-height: 1;
}

.btn--secondary {
    color: var(--primary-deep);
    background: var(--primary-soft);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

/* ========== MESSAGES ========== */
.form-message {
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 13px;
}

.message-error { color: #b91c1c; }
.message-success { color: #047857; }
.form-message a { color: var(--primary-deep); font-weight: 600; }

/* ========== NOTICE ========== */
.notice {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.notice--success {
    color: #047857;
    background: var(--success-soft);
    border-color: rgba(5, 150, 105, 0.16);
}

.notice--error {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.16);
}

.notice--info {
    color: var(--primary-deep);
    background: var(--primary-soft);
    border-color: rgba(37, 99, 235, 0.14);
}

/* ========== METRIC CARD ========== */
.metric-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(240, 247, 255, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.metric-card strong {
    display: block;
    font-size: 26px;
    color: var(--primary-deep);
    line-height: 1;
}

.metric-card span {
    display: block;
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

/* ========== CONTROL TIPS ========== */
.control-tips {
    padding: 18px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(20, 84, 215, 0.96), rgba(82, 157, 255, 0.90));
    color: #fff;
}

.control-tips strong {
    display: block;
    font-size: 16px;
}

.control-tips p {
    margin: 10px 0 0;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.93);
}

/* ========== PLATFORM CARD ========== */
.platform-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.platform-card strong {
    display: block;
    font-size: 16px;
}

.platform-card p {
    margin: 10px 0 0;
    color: var(--text-soft);
    line-height: 1.7;
}

/* ========== TASK GRID (history page) ========== */
.task-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.task-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.task-card__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.task-card__head h3 {
    margin: 10px 0 0;
    font-size: 17px;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.task-meta span {
    padding: 6px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--text-soft);
    background: rgba(15, 36, 64, 0.05);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.status-pill--pending,
.status-pill--processing {
    color: #92400e;
    background: rgba(245, 158, 11, 0.12);
}

.status-pill--completed {
    color: #047857;
    background: var(--success-soft);
}

.status-pill--failed {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.10);
}

.task-card__body { margin-top: 14px; }

.task-error {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: 14px;
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    font-size: 13px;
}

.task-ref {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.task-ref a,
.text-link {
    color: var(--primary-deep);
    font-weight: 600;
}

.task-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.task-gallery__item {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #f4f8ff;
    transition: transform var(--transition-fast);
}

.task-gallery__item:hover {
    transform: scale(1.03);
}

.task-gallery__item img,
.table-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 240px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
}

.task-desc { color: var(--text-soft); line-height: 1.6; font-size: 13px; }
.task-empty { color: var(--text-soft); line-height: 1.6; font-size: 14px; }

/* ========== HISTORY PAGE ========== */
.history-shell {
    padding: 30px;
}

.history-shell--studio {
    background:
        radial-gradient(ellipse 40% 30% at 100% 0%, rgba(96, 165, 250, 0.12), transparent 20%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(236, 244, 255, 0.93));
}

.history-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.history-hero__content h1 {
    margin: 10px 0 0;
    font-size: 36px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #0f2440 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.history-hero__content p {
    margin: 12px 0 0;
    color: var(--text-soft);
    line-height: 1.8;
}

.workspace-stats--history {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0;
    min-width: 420px;
}

.history-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin: 20px 0 24px;
}

.history-toolbar__meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.history-toolbar__meta p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

.workspace-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

/* ========== ADMIN (unchanged) ========== */
.admin-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr); }
.login-panel { padding: 32px; }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.section-heading h2,
.section-heading h1 {
    font-size: 28px;
    margin: 10px 0 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--primary-deep);
    background: var(--primary-soft);
}

.hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-soft);
    background: rgba(15, 36, 64, 0.04);
}

.price-list,
.announcement-list,
.admin-summary {
    display: grid;
    gap: 14px;
}

.price-card,
.announcement-item,
.contact-card,
.summary-row {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.80);
    border: 1px solid var(--line);
}

.price-card strong,
.summary-row strong {
    display: block;
    font-size: 17px;
}

.price-card span {
    display: inline-block;
    margin-top: 6px;
    color: var(--primary-deep);
    font-size: 22px;
    font-weight: 700;
}

.price-card p,
.announcement-item,
.contact-card p,
.summary-row p,
.table-empty {
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 13px;
}

.side-stack { display: grid; gap: 24px; }

.composer,
.side-panel,
.gallery-panel,
.login-panel { padding: 28px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid--compact { max-width: 720px; }

.stack-form { margin-bottom: 18px; }

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pricing-editor { display: grid; gap: 12px; }
.pricing-editor__row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 12px;
}

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.table-prompt { min-width: 280px; line-height: 1.7; }

.table-thumb {
    display: inline-block;
    width: 80px;
    border-radius: 14px;
    overflow: hidden;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .studio-main {
        grid-template-columns: 1fr;
    }

    .preview-column {
        order: -1;
    }
}

@media (max-width: 1100px) {
    .workspace-stats--history { min-width: 0; }
    .task-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding: 16px 0 32px;
    }

    .home-studio { padding: 20px; }

    .topbar,
    .form-actions,
    .section-heading,
    .task-card__head,
    .studio-header,
    .studio-header__actions,
    .preview-card__head,
    .preview-meta,
    .history-hero,
    .history-toolbar,
    .history-toolbar__meta {
        flex-direction: column;
        align-items: stretch;
    }

    .composer,
    .side-panel,
    .gallery-panel,
    .login-panel { padding: 20px; }

    .compose-card { padding: 20px; }

    .studio-header h1,
    .history-hero__content h1 {
        font-size: 28px;
    }

    .preview-screen,
    .preview-screen img {
        min-height: 240px;
    }

    .workspace-stats,
    .workspace-stats--history,
    .preview-stats,
    .form-grid,
    .pricing-editor__row,
    .task-gallery {
        grid-template-columns: 1fr;
    }
}
