/* ==========================================================================
   全站统一视觉层 Global UI（2026-11-28）
   --------------------------------------------------------------------------
   统一主后台 SPA、功能工作台、子账号后台、晚创平台登录页、安装向导的设计语言：
   柔和层次 / 渐变主色 / 克制阴影 / 一致的圆角与间距 / 暗色适配。
   动态主题令牌由 workbench.js 与 site-theme.php 覆盖，本文件只定基线。
   ========================================================================== */

:root {
    --wc-primary: #ec4899;
    --wc-primary-deep: #be185d;
    --wc-primary-soft: #fdf2f8;
    --wc-ink: #1f2937;
    --wc-muted: #8a94a6;
    --wc-line: #e9edf3;
    --wc-surface: #ffffff;
    --wc-canvas: #f6f8fc;
    --wc-radius: 16px;
    --wc-radius-sm: 10px;
    --wc-shadow: 0 8px 28px rgba(31, 41, 55, .07);
    --wc-shadow-lg: 0 18px 48px rgba(31, 41, 55, .12);
    --wc-ease: cubic-bezier(.22, .8, .35, 1);
    --wc-font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

/* ---------- 基础 ---------- */
html, body { font-family: var(--wc-font); }
body { -webkit-font-smoothing: antialiased; }
::selection { background: var(--wc-primary-soft); color: var(--wc-primary-deep); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(138, 148, 166, .32); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(138, 148, 166, .55); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 主后台 SPA（Element Plus） ---------- */
.el-card {
    border: 1px solid var(--wc-line) !important;
    border-radius: var(--wc-radius) !important;
    box-shadow: var(--wc-shadow) !important;
    transition: transform .25s var(--wc-ease), box-shadow .25s var(--wc-ease);
}
.el-card:hover { box-shadow: var(--wc-shadow-lg) !important; }
.el-card__header { border-bottom: 1px solid var(--wc-line) !important; font-weight: 600; }

.el-button {
    border-radius: var(--wc-radius-sm) !important;
    font-weight: 500;
    transition: transform .18s var(--wc-ease), box-shadow .18s var(--wc-ease), background .18s !important;
}
.el-button:not(.is-disabled):active { transform: translateY(1px); }
.el-button--primary {
    box-shadow: 0 6px 16px rgba(236, 72, 153, .24) !important;
    background: linear-gradient(135deg, var(--theme-color, var(--wc-primary)) 0%, var(--theme-color-deep, var(--wc-primary-deep)) 100%) !important;
    border-color: transparent !important;
}
.el-button--primary:hover { box-shadow: 0 10px 22px rgba(236, 72, 153, .32) !important; }

.el-input__wrapper, .el-select__wrapper, .el-textarea__inner {
    border-radius: var(--wc-radius-sm) !important;
    box-shadow: 0 0 0 1px var(--wc-line) inset !important;
    transition: box-shadow .2s var(--wc-ease) !important;
}
.el-input__wrapper:hover, .el-select__wrapper:hover { box-shadow: 0 0 0 1px rgba(236, 72, 153, .35) inset !important; }
.el-input__wrapper.is-focus, .el-select__wrapper.is-focused {
    box-shadow: 0 0 0 1px var(--theme-color, var(--wc-primary)) inset, 0 0 0 3px rgba(236, 72, 153, .10) !important;
}

.el-table { border-radius: var(--wc-radius) !important; overflow: hidden; }
.el-table th.el-table__cell {
    background: #fafbfe !important;
    color: #5b6474 !important;
    font-weight: 600 !important;
    letter-spacing: .2px;
}
.el-table .el-table__row { transition: background .18s; }
.el-table .el-table__row:hover > td { background: var(--wc-primary-soft) !important; }
.el-table td.el-table__cell { border-bottom-color: #f1f3f8 !important; }

.el-tag { border-radius: 999px !important; border: 0 !important; font-weight: 500; }
.el-dialog, .el-drawer, .el-message-box {
    border-radius: var(--wc-radius) !important;
    box-shadow: var(--wc-shadow-lg) !important;
}
.el-dialog__header { border-bottom: 1px solid var(--wc-line); padding-bottom: 14px !important; }
.el-dialog__title { font-weight: 600; }
.el-menu { border-right: 0 !important; }
.el-menu-item.is-active {
    background: var(--wc-primary-soft) !important;
    color: var(--theme-color-deep, var(--wc-primary-deep)) !important;
    font-weight: 600;
    border-radius: var(--wc-radius-sm);
}
.el-page-header, .page-header { font-weight: 600; }
.el-empty__description p { color: var(--wc-muted); }
.el-pagination .el-pager li { border-radius: 8px !important; }
.el-switch__core { border-radius: 999px !important; }
.el-tabs__item.is-active { font-weight: 600; }

/* 页面容器留白 */
.el-main { padding: 20px 22px !important; }
.page { animation: wcFade .32s var(--wc-ease); }
@keyframes wcFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 通用组件类（工作台 / 登录 / 安装共用） ---------- */
.wc-surface {
    background: var(--wc-surface);
    border: 1px solid var(--wc-line);
    border-radius: var(--wc-radius);
    box-shadow: var(--wc-shadow);
}
.wc-grad {
    background: linear-gradient(135deg, var(--theme-color, var(--wc-primary)) 0%, var(--theme-color-deep, var(--wc-primary-deep)) 100%);
}
.wc-muted { color: var(--wc-muted); }
.wc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: 999px; padding: 4px 11px;
    font-size: 12px; font-weight: 500;
    background: var(--wc-primary-soft); color: var(--wc-primary-deep);
}
.wc-chip.ok { background: #ecfdf5; color: #059669; }
.wc-chip.warn { background: #fffbeb; color: #d97706; }
.wc-chip.err { background: #fef2f2; color: #dc2626; }
.wc-divider { height: 1px; background: var(--wc-line); border: 0; margin: 18px 0; }

.wc-input, .wc-select, .wc-textarea {
    width: 100%; border: 1px solid var(--wc-line); border-radius: var(--wc-radius-sm);
    padding: 10px 13px; font-size: 13px; outline: none; background: #fff;
    color: var(--wc-ink); font-family: inherit; transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.wc-input:focus, .wc-select:focus, .wc-textarea:focus {
    border-color: var(--theme-color, var(--wc-primary));
    box-shadow: 0 0 0 3px rgba(236, 72, 153, .11);
}
.wc-textarea { min-height: 92px; resize: vertical; }

.wc-btn {
    border: 0; border-radius: var(--wc-radius-sm); padding: 10px 18px;
    font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
    background: linear-gradient(135deg, var(--theme-color, var(--wc-primary)) 0%, var(--theme-color-deep, var(--wc-primary-deep)) 100%);
    color: #fff; transition: transform .18s var(--wc-ease), box-shadow .18s var(--wc-ease);
    box-shadow: 0 6px 16px rgba(236, 72, 153, .24);
}
.wc-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(236, 72, 153, .30); }
.wc-btn:active { transform: translateY(0); }
.wc-btn.ghost { background: #fff; color: #4b5563; border: 1px solid var(--wc-line); box-shadow: none; }
.wc-btn.ghost:hover { border-color: var(--theme-color, var(--wc-primary)); color: var(--theme-color, var(--wc-primary)); }
.wc-btn.sm { padding: 6px 12px; font-size: 12px; }
.wc-btn.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 6px 16px rgba(220, 38, 38, .2); }

/* ---------- 暗色（由 workbench.js 加 html.wc-dark） ---------- */
html.wc-dark {
    --wc-ink: #e5e7eb;
    --wc-muted: #aeb7c8;
    --wc-line: #2c3446;
    --wc-surface: #1b2130;
    --wc-canvas: #121722;
    --wc-primary-soft: #2a2133;
    --wc-shadow: 0 8px 28px rgba(0, 0, 0, .30);
    --wc-shadow-lg: 0 18px 48px rgba(0, 0, 0, .42);
}
html.wc-dark .wc-input, html.wc-dark .wc-select, html.wc-dark .wc-textarea,
html.wc-dark .wc-btn.ghost { background: #232b3c; color: var(--wc-ink); border-color: #39435a; }
html.wc-dark .wc-surface { background: var(--wc-surface); }
html.wc-dark .el-card, html.wc-dark .el-dialog, html.wc-dark .el-drawer,
html.wc-dark .el-table, html.wc-dark .el-menu { background: var(--wc-surface) !important; color: var(--wc-ink) !important; border-color: var(--wc-line) !important; }
html.wc-dark .el-table th.el-table__cell { background: #242c3e !important; color: #c9d1e0 !important; }
html.wc-dark .el-table td.el-table__cell { border-bottom-color: #2c3446 !important; }
html.wc-dark .el-input__wrapper, html.wc-dark .el-select__wrapper, html.wc-dark .el-textarea__inner { background: #232b3c !important; box-shadow: 0 0 0 1px #39435a inset !important; color: var(--wc-ink) !important; }
html.wc-dark .el-table .el-table__row:hover > td { background: #2a3347 !important; }
html.wc-dark .el-menu-item.is-active { background: #33243f !important; color: #f9a8d4 !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .el-main { padding: 14px !important; }
    .el-card { border-radius: 12px !important; }
    .wc-btn { padding: 10px 14px; }
}

/* ---------- 旧 layui 视图兼容层（admin/views、SDK 示例页） ---------- */
.layui-card {
    border: 1px solid var(--wc-line) !important;
    border-radius: var(--wc-radius) !important;
    box-shadow: var(--wc-shadow) !important;
    overflow: hidden;
}
.layui-card-header {
    border-bottom: 1px solid var(--wc-line) !important;
    font-weight: 600 !important;
    color: var(--wc-ink) !important;
}
.layui-btn {
    border-radius: var(--wc-radius-sm) !important;
    font-weight: 500 !important;
    transition: transform .18s var(--wc-ease), box-shadow .18s var(--wc-ease) !important;
}
.layui-btn:active { transform: translateY(1px); }
.layui-btn-normal, .layui-btn[lay-event="add"] {
    background: linear-gradient(135deg, var(--theme-color, var(--wc-primary)) 0%, var(--theme-color-deep, var(--wc-primary-deep)) 100%) !important;
    box-shadow: 0 6px 16px rgba(236, 72, 153, .22) !important;
    border-color: transparent !important;
}
.layui-table th { background: #fafbfe !important; color: #5b6474 !important; font-weight: 600 !important; }
.layui-table td { border-bottom-color: #f1f3f8 !important; }
.layui-table tbody tr:hover { background: var(--wc-primary-soft) !important; }
.layui-input, .layui-select, .layui-textarea, .layui-form-select .layui-input {
    border-radius: var(--wc-radius-sm) !important;
    border-color: var(--wc-line) !important;
}
.layui-input:focus, .layui-textarea:focus {
    border-color: var(--theme-color, var(--wc-primary)) !important;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, .10) !important;
}
.layui-tab-title li { border-radius: 8px 8px 0 0; }
.layui-tab-title .layui-this { color: var(--theme-color-deep, var(--wc-primary-deep)) !important; font-weight: 600; }
.layui-layer { border-radius: var(--wc-radius) !important; box-shadow: var(--wc-shadow-lg) !important; overflow: hidden; }
html.wc-dark .layui-card, html.wc-dark .layui-table, html.wc-dark .layui-layer {
    background: var(--wc-surface) !important; color: var(--wc-ink) !important; border-color: var(--wc-line) !important;
}


/* ==========================================================================
   焕新版界面层 WC Refresh（2026-11-28 第二轮）
   --------------------------------------------------------------------------
   由 assets/app-refresh.js 在 html 上加 .wc-refresh 激活。
   统一主后台 SPA、工作台、子账号后台、旧 layui 视图、自助下单中心的
   渐变、玻璃质感、层次、动效与暗色，且不覆盖各页原有布局。
   ========================================================================== */

:root {
    --wc-glow-a: rgba(236, 72, 153, .16);
    --wc-glow-b: rgba(139, 92, 246, .12);
    --wc-ring: rgba(236, 72, 153, .14);
    --wc-ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- 页面氛围光（不改动 body 布局） ---------- */
html.wc-refresh body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(70% 48% at 6% -6%, var(--wc-glow-a) 0%, transparent 62%),
        radial-gradient(62% 46% at 104% 104%, var(--wc-glow-b) 0%, transparent 62%);
}
html.wc-refresh.wc-dark body::before {
    background:
        radial-gradient(70% 48% at 6% -6%, rgba(236, 72, 153, .13) 0%, transparent 62%),
        radial-gradient(62% 46% at 104% 104%, rgba(139, 92, 246, .14) 0%, transparent 62%);
}

/* ---------- 通用焕新组件 ---------- */
.wc-hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--wc-radius) + 6px);
    padding: 30px 32px;
    color: #fff;
    background: linear-gradient(125deg,
        var(--theme-color, var(--wc-primary)) 0%,
        var(--theme-color-deep, var(--wc-primary-deep)) 58%,
        #7c3aed 130%);
    box-shadow: 0 18px 44px rgba(190, 24, 93, .24);
}
.wc-hero::after {
    content: "";
    position: absolute;
    width: 320px; height: 320px;
    right: -90px; top: -170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
    pointer-events: none;
}
.wc-hero h1, .wc-hero h2 { margin: 0 0 8px; font-weight: 680; letter-spacing: .4px; }
.wc-hero p { margin: 0; opacity: .88; font-size: 13px; line-height: 1.8; }

.wc-stat {
    display: flex; flex-direction: column; gap: 7px;
    background: var(--wc-surface);
    border: 1px solid var(--wc-line);
    border-radius: var(--wc-radius);
    padding: 17px 19px;
    box-shadow: var(--wc-shadow);
    transition: transform .28s var(--wc-ease-out), box-shadow .28s var(--wc-ease-out);
}
.wc-stat:hover { transform: translateY(-3px); box-shadow: var(--wc-shadow-lg); }
.wc-stat .k { font-size: 11.5px; color: var(--wc-muted); letter-spacing: .4px; }
.wc-stat .v { font-size: 21px; font-weight: 700; color: var(--wc-ink); font-variant-numeric: tabular-nums; }

.wc-stepper { display: flex; align-items: center; gap: 0; }
.wc-stepper .s { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.wc-stepper .n {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: #f1f3f8; color: var(--wc-muted);
    border: 1px solid var(--wc-line);
    transition: .3s var(--wc-ease-out);
}
.wc-stepper .t { font-size: 12.5px; color: var(--wc-muted); }
.wc-stepper .s.on .n {
    background: linear-gradient(135deg, var(--theme-color, var(--wc-primary)), var(--theme-color-deep, var(--wc-primary-deep)));
    color: #fff; border-color: transparent;
    box-shadow: 0 6px 16px rgba(190, 24, 93, .28);
}
.wc-stepper .s.on .t { color: var(--theme-color-deep, var(--wc-primary-deep)); font-weight: 650; }
.wc-stepper .s.done .n { background: #10b981; color: #fff; border-color: transparent; }
.wc-stepper .bar { flex: 1; min-width: 14px; height: 2px; margin: 0 10px; background: var(--wc-line); }
.wc-stepper .bar.done { background: #10b981; }

.wc-empty { text-align: center; padding: 42px 18px; color: var(--wc-muted); }
.wc-empty .ic {
    width: 62px; height: 62px; border-radius: 20px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 27px; background: var(--wc-primary-soft);
    color: var(--theme-color-deep, var(--wc-primary-deep));
}
.wc-empty b { display: block; color: var(--wc-ink); font-size: 14px; margin-bottom: 6px; }

.wc-skeleton {
    background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 50%, #eef1f6 75%);
    background-size: 200% 100%;
    animation: wcShimmer 1.4s linear infinite;
    border-radius: var(--wc-radius-sm);
}
@keyframes wcShimmer { to { background-position: -200% 0; } }
html.wc-dark .wc-skeleton { background: linear-gradient(90deg, #242c3e 25%, #2e374c 50%, #242c3e 75%); background-size: 200% 100%; }

.wc-toast {
    position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 18px);
    z-index: 100000;
    min-width: 200px; max-width: min(88vw, 420px);
    padding: 12px 18px; border-radius: 999px;
    background: rgba(31, 41, 55, .94); color: #fff;
    font-size: 13px; font-weight: 500; text-align: center;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
    opacity: 0; pointer-events: none;
    transition: opacity .28s var(--wc-ease-out), transform .28s var(--wc-ease-out);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.wc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.wc-toast.ok { background: rgba(5, 150, 105, .95); }
.wc-toast.err { background: rgba(220, 38, 38, .95); }

.wc-timeline { position: relative; padding-left: 22px; }
.wc-timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--wc-line); }
.wc-timeline .it { position: relative; padding: 0 0 16px; font-size: 12.5px; color: var(--wc-muted); }
.wc-timeline .it::before {
    content: ""; position: absolute; left: -20px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid var(--theme-color, var(--wc-primary));
}
.wc-timeline .it.ok::before { background: #10b981; border-color: #10b981; }

/* ---------- Element Plus 焕新（SPA 主后台） ---------- */
html.wc-refresh .el-header, html.wc-refresh .el-aside {
    background: var(--wc-surface) !important;
    border-color: var(--wc-line) !important;
}
html.wc-refresh .el-header {
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 2px 18px rgba(31, 41, 55, .05);
}
html.wc-refresh .el-card { overflow: hidden; }
html.wc-refresh .el-card__header {
    background: linear-gradient(180deg, rgba(236, 72, 153, .045), transparent);
}
html.wc-refresh .el-button--primary { letter-spacing: .3px; }
html.wc-refresh .el-tag--primary, html.wc-refresh .el-tag--success {
    border-radius: 999px !important;
}
html.wc-refresh .el-table__header-wrapper th {
    border-bottom-color: var(--wc-line) !important;
}
html.wc-refresh .el-tabs__item.is-active { color: var(--theme-color-deep, var(--wc-primary-deep)) !important; }
html.wc-refresh .el-breadcrumb, html.wc-refresh .el-menu { background: transparent !important; }
html.wc-refresh .el-dialog__header, html.wc-refresh .el-drawer__header {
    background: linear-gradient(180deg, rgba(236, 72, 153, .05), transparent);
    margin-bottom: 0 !important; padding-bottom: 16px !important;
}
html.wc-refresh .el-message, html.wc-refresh .el-notification {
    border-radius: var(--wc-radius-sm) !important;
    box-shadow: var(--wc-shadow-lg) !important;
}
html.wc-refresh .el-switch.is-checked .el-switch__core {
    background: linear-gradient(135deg, var(--theme-color, var(--wc-primary)), var(--theme-color-deep, var(--wc-primary-deep))) !important;
    border-color: transparent !important;
}
html.wc-refresh .el-loading-mask { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

/* ---------- layui 旧视图焕新 ---------- */
html.wc-refresh .layui-card-header {
    background: linear-gradient(180deg, rgba(236, 72, 153, .05), transparent) !important;
}
html.wc-refresh .layui-btn-normal, html.wc-refresh .layui-btn[lay-event="add"] {
    letter-spacing: .3px;
}
html.wc-refresh .layui-table-tool, html.wc-refresh .layui-table-page { background: #fafbfe !important; }
html.wc-refresh .layui-form-label { color: #4b5563 !important; font-weight: 550; }
html.wc-refresh .layui-layer-title {
    background: linear-gradient(180deg, rgba(236, 72, 153, .06), transparent) !important;
    font-weight: 600 !important;
}
html.wc-refresh .layui-tab-title .layui-this::after { border-bottom-color: var(--theme-color, var(--wc-primary)) !important; }

/* ---------- 工作台 / 子账号后台 ---------- */
html.wc-refresh .topbar, html.wc-refresh .side .logo, html.wc-refresh .brand .dot {
    background: linear-gradient(125deg,
        var(--theme-color, var(--wc-primary)) 0%,
        var(--theme-color-deep, var(--wc-primary-deep)) 58%,
        #7c3aed 135%) !important;
}
html.wc-refresh .card { overflow: hidden; }
html.wc-refresh .card h2::before, html.wc-refresh .group-title { color: var(--theme-color-deep, var(--wc-primary-deep)); }

/* ---------- 焕新版暗色补强 ---------- */
html.wc-refresh.wc-dark .wc-stat, html.wc-refresh.wc-dark .wc-empty .ic { background: var(--wc-surface); }
html.wc-refresh.wc-dark .wc-stepper .n { background: #242c3e; }
html.wc-refresh.wc-dark .el-card__header,
html.wc-refresh.wc-dark .layui-card-header,
html.wc-refresh.wc-dark .el-dialog__header { background: rgba(236, 72, 153, .07) !important; }
html.wc-refresh.wc-dark .layui-table-tool, html.wc-refresh.wc-dark .layui-table-page { background: #20283a !important; }

/* ---------- 进入动效 ---------- */
html.wc-refresh .wc-enter { animation: wcEnter .46s var(--wc-ease-out) both; }
@keyframes wcEnter { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    html.wc-refresh * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
