/* =====================================================================
   惠利得 · 功能页主题层（叠加在 style.css 之后）
   统一：页头、卡片、表单、按钮、上传区、状态标签、弹窗。
   ===================================================================== */

/* 旧令牌映射到新设计系统，style.css 中基于令牌的规则自动换肤 */
:root {
    --bg: var(--hy-bg);
    --bg-soft: var(--hy-muted-bg);
    --surface: var(--hy-surface);
    --surface-2: var(--hy-subtle);
    --surface-3: var(--hy-muted-bg);
    --ink: var(--hy-text);
    --ink-2: var(--hy-text-2);
    --muted: var(--hy-muted);
    --muted-2: var(--hy-faint);
    --hint: #b4b4bb;
    --line: var(--hy-border);
    --line-2: var(--hy-border-strong);
    --primary: var(--hy-brand);
    --primary-2: var(--hy-brand-hover);
    --primary-soft: var(--hy-brand-soft);
    --accent: #27272a;
    --accent-2: #18181b;
    --success: var(--hy-success);
    --success-soft: var(--hy-success-soft);
    --danger: var(--hy-danger);
    --danger-soft: var(--hy-danger-soft);
    --warn: var(--hy-warn);
    --warn-soft: var(--hy-warn-soft);
    --info: var(--hy-info);
    --info-soft: var(--hy-info-soft);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --shadow-sm: var(--hy-shadow-xs);
    --shadow: var(--hy-shadow-sm);
    --shadow-lg: var(--hy-shadow-lg);
    --font: var(--hy-font);
    --font-mono: var(--hy-mono);
}

body { font-size: 13.5px; }

/* Keep history visible beside the workspace on laptop-sized screens. */
@media (min-width: 1100px) {
    body.hy-has-sidebar .main-container.detail-workspace {
        grid-template-columns: minmax(300px, 350px) minmax(240px, 1fr) minmax(205px, 240px);
        min-width: 0;
    }
    body.hy-has-sidebar .detail-workspace > .detail-config-panel,
    body.hy-has-sidebar .detail-workspace > .result-panel,
    body.hy-has-sidebar .detail-workspace > .detail-history-panel {
        min-width: 0;
        height: calc(100vh - 68px);
        overflow-y: auto;
        position: static;
    }
    body.hy-has-sidebar .detail-history-panel .history-list {
        display: flex;
        flex-direction: column;
        height: calc(100% - 48px);
        max-height: none;
        overflow-y: auto;
    }
    body.hy-has-sidebar .detail-history-panel .history-item { flex-shrink: 0; }
}

/* ---------------------------------------------------------------------
   页面容器
   --------------------------------------------------------------------- */
.page-shell {
    width: auto;
    max-width: 1680px;
    margin: 0 auto;
    padding: 24px 28px 48px;
}

/* ---------------------------------------------------------------------
   页头（原 Hero 大横幅 → 简洁页头 + 提示侧栏）
   --------------------------------------------------------------------- */
.hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 20px;
}
.hero-main,
.hero-side { box-shadow: none; border-radius: var(--hy-radius-lg); }
.hero-main {
    padding: 4px 0 0;
    background: transparent;
    border: 0;
    overflow: visible;
}
.hero-main::after,
.hero-side::after { display: none; }

.eyebrow {
    gap: 6px;
    margin-bottom: 10px;
    padding: 2px 8px;
    border: 1px solid var(--hy-brand-soft-2);
    border-radius: var(--hy-radius-sm);
    background: var(--hy-brand-soft);
    color: var(--hy-brand-ink);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .2px;
}
.eyebrow::before {
    width: 5px;
    height: 5px;
    background: var(--hy-brand);
    box-shadow: none;
}
.hero h1 {
    margin-bottom: 6px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: -.01em;
    color: var(--hy-text);
}
.hero p {
    max-width: 860px;
    color: var(--hy-muted);
    font-size: 13.5px;
    line-height: 1.7;
}

.hero-side {
    padding: 14px 16px;
    gap: 6px;
    background: var(--hy-surface);
    border: 1px solid var(--hy-border);
    color: var(--hy-text);
}
.hero-side strong {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hy-text);
    letter-spacing: 0;
}
.hero-side strong::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e54d2e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 16v-4'/><path d='M12 8h.01'/></svg>") center / contain no-repeat;
}
.hero-side span { color: var(--hy-muted); font-size: 12.5px; line-height: 1.6; }
.capability-grid { gap: 6px; margin-top: 6px; }
.capability {
    padding: 7px 9px;
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-sm);
    background: var(--hy-subtle);
}
.capability b { color: var(--hy-text); font-size: 12px; font-weight: 600; margin: 0; }
.capability small { color: var(--hy-muted); font-size: 11px; }

.pipeline { gap: 10px; }
.step-chip {
    padding: 12px 14px;
    border-radius: var(--hy-radius-lg);
    box-shadow: none;
}
.step-chip b {
    width: 26px;
    height: 26px;
    border-radius: var(--hy-radius-sm);
    background: var(--hy-muted-bg);
    color: var(--hy-text);
    font-size: 12px;
}

/* ---------------------------------------------------------------------
   卡片
   --------------------------------------------------------------------- */
.panel {
    border-radius: var(--hy-radius-lg);
    border-color: var(--hy-border);
    box-shadow: var(--hy-shadow-xs);
}
.panel:hover { box-shadow: var(--hy-shadow-xs); }
.panel-head {
    padding: 13px 16px;
    align-items: center;
    background: var(--hy-surface);
}
.panel-title { gap: 10px; align-items: center; }
.panel-title .num {
    width: 22px;
    height: 22px;
    border-radius: var(--hy-radius-sm);
    background: var(--hy-text);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    box-shadow: none;
}
.panel-title h2 { font-size: 14px; font-weight: 600; margin: 0; }
.panel-title p { font-size: 12px; color: var(--hy-muted); margin-top: 1px; }
.panel-body { padding: 16px; }

/* ---------------------------------------------------------------------
   表单
   --------------------------------------------------------------------- */
label {
    color: var(--hy-text-2);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
}

textarea,
input[type="text"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="password"],
select {
    border: 1px solid var(--hy-border-strong);
    border-radius: var(--hy-radius);
    background-color: var(--hy-surface);
    color: var(--hy-text);
    font-size: 13px;
    padding: 8px 11px;
    box-shadow: var(--hy-shadow-xs);
}
select { padding-right: 32px; background-position: right 10px center; }
textarea { line-height: 1.65; }
textarea:hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
select:hover { border-color: #c4c4cc; }
textarea:focus,
input:focus,
select:focus {
    border-color: var(--hy-brand);
    box-shadow: 0 0 0 3px var(--hy-brand-ring);
}
input::placeholder,
textarea::placeholder { color: #b4b4bb; }

.radio-label {
    padding: 9px 11px;
    border-radius: var(--hy-radius);
    border-color: var(--hy-border);
}
.radio-label:has(input:checked) {
    border-color: var(--hy-brand);
    background: var(--hy-brand-soft);
    color: var(--hy-brand-ink);
    box-shadow: 0 0 0 1px var(--hy-brand) inset;
}
.radio-label input[type="radio"],
input[type="checkbox"],
input[type="radio"],
input[type="range"] { accent-color: var(--hy-brand); }
.radio-label:has(input:checked) .radio-text small { color: var(--hy-brand-ink); opacity: .8; }

.prompt-input-card {
    border-radius: var(--hy-radius-lg);
    background: var(--hy-subtle);
}
.prompt-mode-banner {
    border-radius: var(--hy-radius);
    background: var(--hy-brand-soft);
    border-color: var(--hy-brand-soft-2);
}
.prompt-mode-banner b { color: var(--hy-brand-ink); }
.prompt-example { border-radius: var(--hy-radius); }

/* ---------------------------------------------------------------------
   按钮
   --------------------------------------------------------------------- */
button {
    border-radius: var(--hy-radius);
    font-weight: 500;
    letter-spacing: 0;
}
button:active { transform: none; }

.btn-primary,
.btn-generate,
.btn-scan {
    background: var(--hy-brand);
    color: #fff;
    border: 1px solid var(--hy-brand-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--hy-shadow-xs);
    font-weight: 600;
}
.btn-primary:hover:not(:disabled),
.btn-generate:hover:not(:disabled),
.btn-scan:hover:not(:disabled) {
    background: var(--hy-brand-hover);
    transform: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--hy-shadow-sm);
}
.btn-generate {
    min-height: 40px;
    padding: 10px 14px;
    border-radius: var(--hy-radius);
    font-size: 14px;
}

.btn-orange,
.btn-accent {
    background: #27272a;
    color: #fff;
    border: 1px solid #18181b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), var(--hy-shadow-xs);
}
.btn-orange:hover:not(:disabled),
.btn-accent:hover:not(:disabled) {
    background: #18181b;
    transform: none;
    box-shadow: var(--hy-shadow-sm);
}

.btn-ghost,
.btn-cancel,
.btn-toggle {
    background: var(--hy-surface);
    color: var(--hy-text-2);
    border: 1px solid var(--hy-border-strong);
    box-shadow: var(--hy-shadow-xs);
}
.btn-ghost:hover:not(:disabled),
.btn-toggle:hover {
    background: var(--hy-hover);
    border-color: #c4c4cc;
    color: var(--hy-text);
}
.btn-cancel:hover {
    background: var(--hy-danger-soft);
    border-color: rgba(220, 38, 38, .35);
    color: var(--hy-danger-ink);
}
a.btn-ghost { display: inline-flex; align-items: center; justify-content: center; }

.btn-mini {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--hy-radius-sm);
}

.btn-download,
.btn-confirm {
    background: var(--hy-success);
    border: 1px solid var(--hy-success-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--hy-shadow-xs);
}
.btn-download:hover:not(:disabled),
.btn-confirm:hover {
    background: var(--hy-success-ink);
    transform: none;
    box-shadow: var(--hy-shadow-sm);
}
.btn-retry {
    background: var(--hy-danger);
    border-radius: var(--hy-radius-sm);
}
.btn-retry:hover { transform: none; background: var(--hy-danger-ink); }

/* ---------------------------------------------------------------------
   状态标签
   --------------------------------------------------------------------- */
.status-pill {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--hy-surface);
    border-color: var(--hy-border);
    color: var(--hy-text-2);
    font-weight: 500;
}
.status-pill.is-running { background: var(--hy-info-soft); color: var(--hy-info-ink); border-color: rgba(37, 99, 235, .2); }
.status-pill.is-running::before { background: var(--hy-info); }
.status-pill.is-done { background: var(--hy-success-soft); color: var(--hy-success-ink); border-color: rgba(22, 163, 74, .2); }
.status-pill.is-error { background: var(--hy-danger-soft); color: var(--hy-danger-ink); border-color: rgba(220, 38, 38, .2); }
.status-pill.is-warn { background: var(--hy-warn-soft); color: var(--hy-warn-ink); border-color: rgba(217, 119, 6, .22); }

.status-badge { padding: 2px 9px; font-weight: 500; }
.status-badge.generating_prompts { background: var(--hy-info-soft); color: var(--hy-info-ink); }
.status-badge.generating_images { background: var(--hy-brand-soft); color: var(--hy-brand-ink); }

/* ---------------------------------------------------------------------
   上传区
   --------------------------------------------------------------------- */
.upload-area,
.drop-zone {
    border: 1px dashed var(--hy-border-strong);
    border-radius: var(--hy-radius-lg);
    background: var(--hy-subtle);
}
.upload-area:hover,
.upload-area.dragover,
.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--hy-brand);
    background: var(--hy-brand-soft);
}
.upload-area .upload-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--hy-radius);
    border: 1px solid var(--hy-border);
    background: var(--hy-surface);
    color: var(--hy-text-2);
    font-size: 18px;
    box-shadow: var(--hy-shadow-xs);
}
.upload-area:hover .upload-icon { color: var(--hy-brand); border-color: var(--hy-brand-soft-2); }

/* ---------------------------------------------------------------------
   空状态 / 日志
   --------------------------------------------------------------------- */
.empty-state {
    padding: 64px 20px;
    border-radius: var(--hy-radius-lg);
    border-color: var(--hy-border-strong);
    background: var(--hy-subtle);
}
.empty-icon { font-size: 40px; opacity: .55; filter: grayscale(1); }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--hy-text); }
.empty-state p { font-size: 13px; }

.log-panel,
.log-box {
    background: #18181b;
    border-color: #27272a;
    border-radius: var(--hy-radius-lg);
    box-shadow: none;
}

.history-box {
    border-radius: var(--hy-radius-lg);
    background: var(--hy-subtle);
}

/* ---------------------------------------------------------------------
   弹窗 / 灯箱
   --------------------------------------------------------------------- */
.modal,
.lightbox { backdrop-filter: blur(4px); }
.modal-content,
.modal-card { border-radius: var(--hy-radius-lg); box-shadow: var(--hy-shadow-lg); }

/* ---------------------------------------------------------------------
   响应式
   --------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .page-shell { padding: 16px 16px 40px; }
    .hero h1 { font-size: 19px; }
}

/* 各页面 Hero 变体统一（去掉渐变底、统一侧栏宽度） */
.hero.copy-hero,
.hero.new-copy-hero,
.hero.video-gen-hero,
.hero.single-hero,
.hero.image-editor-hero,
.hero.text-editor-hero { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 24px; }
.hero .hero-main,
.copy-hero .hero-main,
.new-copy-hero .hero-main { background: transparent; border: 0; box-shadow: none; padding: 4px 0 0; }
.hero .hero-side,
.video-gen-hero .hero-side {
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: var(--hy-radius-lg);
    box-shadow: none;
}
.video-gen-hero .hero-side strong { font-size: 13px; }
.hero-side .status-pill { margin-top: 4px; }
@media (max-width: 1260px) {
    .hero.copy-hero, .hero.new-copy-hero, .hero.video-gen-hero, .hero.single-hero,
    .hero.image-editor-hero, .hero.text-editor-hero { grid-template-columns: 1fr; }
}

a.btn-ghost { min-height: 34px; padding: 8px 14px; text-decoration: none; }
@media (max-width: 720px) {
    .hero-side .capability-grid { display: none; }
}
