/* console-refine.css
   参考成熟 API 控制台（api.xpiki.com 等）的信息密度与层级，对工作台做局部精修。
   仅覆盖视觉层，不改动任何业务结构与脚本。
   加载顺序：design-system.css -> workspace.css -> console-base.css -> console-refine.css */

:root {
    --console-topbar-h: 56px;
}

/* ---------- 顶栏：压缩到 56px，导航贴紧品牌，右侧操作区收紧 ---------- */

.enterprise-header {
    min-height: var(--console-topbar-h);
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(0, 21, 41, 0.06);
}

.enterprise-header-inner {
    width: min(1400px, calc(100% - 36px));
    min-height: var(--console-topbar-h);
    gap: 18px;
}

.enterprise-brand {
    min-height: 36px;
    gap: 8px;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.enterprise-brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 15px;
}

.enterprise-nav {
    gap: 2px;
}

.enterprise-nav .nav-item {
    min-width: 76px;
    font-size: 13px;
    font-weight: 600;
}

.enterprise-actions {
    gap: 6px;
}

.header-balance,
.header-action,
.theme-toggle-btn {
    height: 32px;
    min-height: 32px;
    border-radius: 6px;
    font-size: 12px;
}

.header-balance {
    padding: 0 10px;
    background: var(--surface-muted);
    font-variant-numeric: tabular-nums;
}

.header-balance strong {
    font-family: "JetBrains Mono", Consolas, monospace;
}

.theme-toggle-btn {
    width: 32px;
}

.svc-badge {
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
}

/* ---------- 页面容器：控制台式紧凑留白 ---------- */

.enterprise-page {
    width: min(1400px, calc(100% - 36px));
    padding: 20px 0 48px;
}

.announcement-banner {
    margin-bottom: 16px;
    border-radius: var(--console-radius);
    box-shadow: var(--console-card-shadow);
}

/* ---------- 页头：由营销式大标题改为控制台页标题 ---------- */

.page-intro {
    margin-bottom: 16px;
    padding-bottom: 14px;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.page-eyebrow {
    margin-bottom: 4px;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.page-intro h1 {
    margin-bottom: 4px;
    font-family: var(--font-sans);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
}

.page-intro p {
    font-size: 13px;
    line-height: 1.6;
}

.page-guide {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 11px;
}

/* ---------- 卡片：统一圆角与轻投影 ---------- */

.workflow-card,
.summary-card,
.orders-card,
.support-card {
    border-radius: var(--console-radius);
    box-shadow: var(--console-card-shadow);
}

.task-layout {
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 16px;
}

.workflow-card-head {
    min-height: 60px;
    padding: 13px 18px;
}

.workflow-card-title h2 {
    font-size: 15px;
}

.sub-tabs {
    padding: 2px;
}

.sub-tab {
    min-height: 30px;
    font-size: 12px;
}

.workflow-steps {
    padding: 10px 18px;
}

.workflow-card form {
    padding: 18px;
}

.form-section {
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.form-section-heading {
    margin-bottom: 12px;
    gap: 10px;
}

.form-section-heading > span {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 5px;
    font-size: 10px;
}

.form-section-heading h3 {
    font-size: 13px;
}

.field-grid {
    gap: 14px;
}

.form-group {
    margin-bottom: 14px;
}

label {
    margin-bottom: 6px;
    font-size: 12px;
}

input,
textarea,
select {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
}

textarea {
    min-height: 150px;
}

.btn {
    min-height: 36px;
    border-radius: 6px;
    font-size: 13px;
}

.btn-compact {
    min-height: 26px;
    height: 26px;
}

.operation-note {
    margin-bottom: 16px;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
}

.result {
    border-radius: 6px;
}

/* ---------- 任务摘要：去掉深色大卡的突兀感 ---------- */

.summary-column {
    top: calc(var(--console-topbar-h) + 14px);
    gap: 12px;
}

.summary-card {
    padding: 16px 18px;
}

.summary-card.dark,
html.dark .summary-card.dark {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.summary-card.dark .summary-label,
.summary-card.dark .summary-total > span,
.summary-card.dark .summary-total small {
    color: var(--ink-muted);
}

.summary-card.dark h3 {
    margin: 4px 0 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
}

.summary-card.dark .summary-line {
    padding: 9px 0;
    border-top-color: var(--line);
    color: var(--ink-muted);
}

.summary-card.dark .summary-line strong {
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
}

.summary-card.dark .summary-total {
    padding-top: 12px;
    border-top-color: var(--line-strong);
}

.summary-card.dark .summary-total strong {
    color: var(--ink);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

.summary-card.dark .summary-checklist {
    margin-top: 12px;
    color: var(--ink-muted);
}

.summary-card.dark .summary-checklist li::before {
    border-color: var(--success);
}

.support-card {
    padding: 16px 18px;
}

/* ---------- 订单中心：表格化密度 ---------- */

.orders-card {
    padding: 18px;
}

.orders-toolbar {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.orders-toolbar-copy h2 {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
}

.search-bar {
    max-width: 340px;
}

.search-bar input {
    min-height: 34px;
    padding-left: 34px;
}

.search-bar .icon {
    left: 11px;
    font-size: 13px;
}

.order-list {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
}

.history-item {
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    transition: background 0.15s ease;
}

.history-item:last-child {
    border-bottom: 0;
}

.history-item:hover {
    background: var(--surface-muted);
}

.history-email {
    font-size: 13px;
}

.history-order,
.history-created {
    font-size: 11px;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.empty-state {
    min-height: 240px;
}

/* ---------- 弹窗 ---------- */

.modal {
    border-radius: var(--console-radius);
}

.modal-head h3 {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 18px;
}

/* ---------- 响应式：移动端顶栏与操作区不拥挤 ---------- */

@media (max-width: 1020px) {
    .enterprise-header-inner,
    .enterprise-page {
        width: min(100% - 24px, 900px);
    }

    .task-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-column {
        gap: 12px;
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .enterprise-header-inner {
        min-height: 52px;
        padding: 0 12px;
        gap: 8px;
    }

    .enterprise-page {
        width: calc(100% - 24px);
        padding: 16px 0 40px;
    }

    .header-balance,
    .header-action,
    .theme-toggle-btn {
        height: 36px;
        min-height: 36px;
    }

    .theme-toggle-btn {
        width: 36px;
    }

    .enterprise-nav {
        height: 42px;
        width: calc(100% + 24px);
        margin: 0 -12px;
    }

    .page-intro h1 {
        font-size: 18px;
    }

    .workflow-card-head,
    .workflow-card form,
    .orders-card {
        padding: 14px;
    }

    .workflow-steps {
        padding: 10px 14px;
    }

    input,
    select,
    .btn,
    .btn-primary {
        min-height: 40px;
    }
}

/* ---------- 窄屏兜底：任何卡片都不得撑出视口 ---------- */

@media (max-width: 420px) {
    .task-layout,
    .summary-column {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-column,
    .summary-card,
    .support-card,
    .orders-card,
    .workflow-card {
        min-width: 0;
        max-width: 100%;
    }
}
