/* ==========================================================================
   AI 创作平台 · 全站样式
   暗色科技风：背景 #06070f，主色 #c455ff，辅助 #7c5cff
   所有样式均为本地文件，不依赖任何 CDN
   ========================================================================== */

/* --------------------------------------------------------------------------
   设计变量
   -------------------------------------------------------------------------- */
:root {
    --bg: #06070f;
    --bg-soft: #0b0d1a;
    --primary: #c455ff;
    --secondary: #7c5cff;
    --text: #eceefb;
    --muted: #9aa0be;
    --card-bg: rgba(255, 255, 255, .045);
    --card-border: rgba(255, 255, 255, .09);
    --card-hover-border: rgba(196, 85, 255, .55);
    --blur: blur(14px);
    --radius: 20px;
    --radius-sm: 12px;
    --grad: linear-gradient(135deg, #7c5cff, #c455ff);
    --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(196, 85, 255, .18));
    --ok: #37d99a;
    --warn: #ffc65c;
    --danger: #ff6b81;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --nav-h: 68px;
    --max-w: 1180px;
}

/* --------------------------------------------------------------------------
   基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: #e2a6ff;
}

img {
    max-width: 100%;
    display: block;
}

code {
    font-family: "JetBrains Mono", Consolas, Monaco, monospace;
    font-size: .9em;
    color: #d9c2ff;
    background: rgba(124, 92, 255, .12);
    padding: 1px 6px;
    border-radius: 6px;
}

h1, h2, h3, h4 {
    margin: 0 0 10px;
    line-height: 1.3;
    font-weight: 700;
}

p {
    margin: 0 0 10px;
}

::selection {
    background: rgba(196, 85, 255, .35);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #080a14;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 92, 255, .35);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 85, 255, .5);
}

/* --------------------------------------------------------------------------
   背景：固定径向渐变光晕 + 网格纹理
   -------------------------------------------------------------------------- */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
}

.glow-1 {
    width: 520px;
    height: 520px;
    top: -160px;
    left: -80px;
    background: radial-gradient(circle, rgba(196, 85, 255, .75), transparent 68%);
}

.glow-2 {
    width: 620px;
    height: 620px;
    top: 8%;
    right: -220px;
    background: radial-gradient(circle, rgba(124, 92, 255, .7), transparent 68%);
}

.glow-3 {
    width: 560px;
    height: 560px;
    bottom: -240px;
    left: 28%;
    background: radial-gradient(circle, rgba(64, 140, 255, .45), transparent 70%);
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 25%, transparent 78%);
}

/* --------------------------------------------------------------------------
   导航
   -------------------------------------------------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: rgba(6, 7, 15, .72);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.nav-inner {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: .3px;
}

.logo:hover {
    color: var(--text);
}

.logo-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--grad);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(124, 92, 255, .45);
}

.logo-text {
    font-size: 16px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    color: var(--muted);
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .05);
}

.nav-user {
    color: var(--muted);
    font-size: 14px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.points-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: #f0ddff;
    background: var(--grad-soft);
    border: 1px solid rgba(196, 85, 255, .35);
}

.points-pill:hover {
    border-color: var(--primary);
    color: #fff;
}

.points-pill b {
    color: #fff;
}

.points-label {
    color: var(--muted);
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   页面容器
   -------------------------------------------------------------------------- */
.page {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 34px 22px 70px;
}

.section {
    margin-top: 44px;
}

.section-head {
    margin-bottom: 20px;
}

.section-head h2 {
    font-size: 22px;
}

.section-head p {
    color: var(--muted);
    margin: 0;
}

.section-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.page-title {
    font-size: 26px;
    margin-bottom: 6px;
}

.page-sub {
    color: var(--muted);
    margin: 0;
    max-width: 660px;
}

/* 栅格 */
.grid {
    display: grid;
    gap: 20px;
}

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

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

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

.row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.row > .input {
    flex: 1 1 200px;
}

.row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

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

/* --------------------------------------------------------------------------
   玻璃卡片
   -------------------------------------------------------------------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 24px;
    transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--card-hover-border);
    box-shadow: 0 20px 50px rgba(124, 92, 255, .18);
}

.card-title {
    font-size: 17px;
    margin-bottom: 16px;
}

.table-card {
    padding: 10px 8px;
    overflow-x: auto;
}

.table-card:hover {
    transform: none;
}

/* 产品卡片 */
.app-card {
    display: flex;
    flex-direction: column;
}

.app-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    font-size: 24px;
    border-radius: 16px;
    background: var(--grad-soft);
    border: 1px solid rgba(196, 85, 255, .3);
    margin-bottom: 14px;
}

.app-name {
    font-size: 19px;
    margin-bottom: 4px;
}

.app-slogan {
    color: var(--primary);
    font-size: 13px;
    margin-bottom: 10px;
}

.app-desc {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.feature-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.feature-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13.5px;
    color: var(--muted);
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--grad);
}

.app-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.price-tag {
    font-size: 13px;
    color: var(--muted);
}

.price-tag b {
    color: #fff;
    font-size: 17px;
}

/* 步骤卡 */
.step-card {
    position: relative;
}

.step-no {
    font-size: 30px;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 6px;
}

.step-card h4 {
    font-size: 17px;
}

.step-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

/* 余额 / 统计卡 */
.balance-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    min-width: 240px;
}

.balance-card:hover {
    transform: none;
}

.balance-label,
.stat-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.balance-value {
    font-size: 22px;
    color: #fff;
    margin-right: auto;
}

.balance-card-lg {
    padding: 28px;
}

.balance-value-lg {
    display: block;
    font-size: 44px;
    line-height: 1.1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 6px 0;
}

.balance-hint {
    color: var(--muted);
    font-size: 13px;
}

.price-table {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding-top: 12px;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 13.5px;
    color: var(--muted);
}

.price-row b {
    color: var(--text);
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-value {
    font-size: 30px;
    line-height: 1.2;
    color: #fff;
}

.stat-sub {
    color: var(--muted);
    font-size: 13px;
}

.stat-breakdown {
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 10px 26px rgba(124, 92, 255, .32);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(196, 85, 255, .45);
    color: #fff;
}

.btn-ghost {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .12);
    color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-xs {
    padding: 4px 9px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 26px;
    font-size: 15.5px;
}

.btn-block {
    width: 100%;
}

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */
.form-card {
    padding: 26px;
}

.form-card:hover {
    transform: none;
}

.form-card-inline {
    padding: 22px;
}

.fieldset {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin: 0 0 20px;
}

.fieldset legend {
    padding: 0 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.field {
    display: block;
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 13.5px;
    color: #c9cde6;
    margin-bottom: 7px;
    font-weight: 600;
}

.field-hint {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 6px;
}

.input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(8, 9, 20, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.input::placeholder {
    color: #6b7093;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 85, 255, .16);
}

.input-sm {
    width: 110px;
}

.input-xs {
    width: 92px;
}

.textarea {
    resize: vertical;
    min-height: 76px;
    line-height: 1.6;
}

select.input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #9aa0be 50%), linear-gradient(135deg, #9aa0be 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

select.input option {
    background: #0c0e1c;
    color: var(--text);
}

.advanced {
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 6px;
}

.advanced summary {
    cursor: pointer;
    font-size: 13.5px;
    color: #c9cde6;
    font-weight: 600;
}

.advanced[open] summary {
    margin-bottom: 12px;
}

.form-error {
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255, 107, 129, .12);
    border: 1px solid rgba(255, 107, 129, .42);
    color: #ffc2cb;
    font-size: 13.5px;
}

.form-error[hidden] {
    display: none;
}

.form-tip {
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
    margin: 12px 0 0;
}

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

/* 预估消耗条 */
.cost-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    background: var(--grad-soft);
    border: 1px solid rgba(196, 85, 255, .28);
    font-size: 14px;
}

.cost-bar b {
    font-size: 20px;
    color: #fff;
}

.cost-bar.is-short {
    background: rgba(255, 107, 129, .12);
    border-color: rgba(255, 107, 129, .45);
}

.cost-note {
    margin-left: auto;
    color: var(--muted);
    font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   上传组件
   -------------------------------------------------------------------------- */
.upload {
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(255, 255, 255, .18);
    background: rgba(8, 9, 20, .5);
    padding: 14px;
    transition: border-color .22s ease, background .22s ease;
}

.upload.is-dragover {
    border-color: var(--primary);
    background: rgba(196, 85, 255, .1);
}

.upload.is-uploading {
    border-style: solid;
}

.upload-input {
    display: none; /* 真实的 file 控件始终隐藏，由拖拽区代理点击 */
}

.upload-drop {
    cursor: pointer;
    text-align: center;
    padding: 14px 10px;
}

.upload-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--grad-soft);
    border: 1px solid rgba(196, 85, 255, .28);
    font-size: 18px;
    color: #fff;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 14px;
    margin: 0 0 4px;
}

.upload-hint {
    color: var(--muted);
    font-size: 12.5px;
    margin: 0;
}

.link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.progress-track {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--grad);
    transition: width .2s ease;
}

.progress-pct {
    font-size: 12.5px;
    color: var(--muted);
    min-width: 38px;
    text-align: right;
}

.upload-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 13px;
}

.upload-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item-size {
    color: var(--muted);
    font-size: 12px;
}

.upload-item-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
}

.upload-item-remove:hover {
    color: var(--danger);
}

/* 模板选择 */
.template-box {
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: rgba(8, 9, 20, .5);
}

.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
}

.template-item {
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .03);
    transition: border-color .2s ease, transform .2s ease;
}

.template-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.template-cover {
    height: 74px;
    background: var(--grad-soft);
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
}

.template-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-name {
    padding: 6px 8px;
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 8px;
}

/* --------------------------------------------------------------------------
   任务卡片
   -------------------------------------------------------------------------- */
.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.task-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 18px;
    transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.task-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-hover-border);
    box-shadow: 0 18px 44px rgba(124, 92, 255, .16);
}

.task-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.task-app {
    font-size: 12.5px;
    color: var(--primary);
    background: var(--grad-soft);
    border: 1px solid rgba(196, 85, 255, .28);
    padding: 3px 10px;
    border-radius: 999px;
}

.task-title {
    font-size: 15.5px;
    margin-bottom: 8px;
    word-break: break-word;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 12.5px;
}

.task-state {
    color: #8f95b6;
}

.task-error {
    margin: 12px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 107, 129, .1);
    border: 1px solid rgba(255, 107, 129, .32);
    color: #ffc2cb;
    font-size: 12.5px;
    word-break: break-word;
}

.task-error[hidden] {
    display: none;
}

.task-result {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(55, 217, 154, .08);
    border: 1px solid rgba(55, 217, 154, .28);
}

.task-result[hidden] {
    display: none;
}

.result-link {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #8ff0c6;
}

.task-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.is-pending {
    color: #ffd79a;
    background: rgba(255, 198, 92, .12);
    border-color: rgba(255, 198, 92, .35);
}

.is-processing {
    color: #b9a6ff;
    background: rgba(124, 92, 255, .16);
    border-color: rgba(124, 92, 255, .4);
}

.is-success {
    color: #8ff0c6;
    background: rgba(55, 217, 154, .12);
    border-color: rgba(55, 217, 154, .35);
}

.is-failed {
    color: #ffb1bd;
    background: rgba(255, 107, 129, .12);
    border-color: rgba(255, 107, 129, .35);
}

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    color: #c9cde6;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
}

/* --------------------------------------------------------------------------
   表格
   -------------------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table thead th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 12.5px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    vertical-align: middle;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, .025);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.ta-right {
    text-align: right;
}

.ta-center {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

.muted {
    color: var(--muted);
    font-size: 12.5px;
}

.text-up {
    color: var(--ok);
}

.text-down {
    color: var(--danger);
}

.cell-result {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   筛选条 / 标签页 / 分页
   -------------------------------------------------------------------------- */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
}

.filter-bar:hover {
    transform: none;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
}

.filter-item .input {
    min-width: 160px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding-bottom: 12px;
}

.tab {
    padding: 8px 16px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    border: 1px solid transparent;
    transition: all .2s ease;
}

.tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .05);
}

.tab.is-active {
    color: #fff;
    background: var(--grad);
    box-shadow: 0 8px 22px rgba(124, 92, 255, .32);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.page-link {
    min-width: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
}

.page-link:hover {
    color: #fff;
    border-color: var(--primary);
}

.page-link.is-active {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
}

.page-link.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.page-info {
    color: var(--muted);
    font-size: 13px;
    margin-left: 6px;
}

/* --------------------------------------------------------------------------
   空状态 / 提示
   -------------------------------------------------------------------------- */
.empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--muted);
}

.empty h1 {
    font-size: 22px;
    color: var(--text);
}

.empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.card.empty:hover {
    transform: none;
}

.toast-wrap {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 200px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    color: var(--text);
    background: rgba(14, 16, 30, .94);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: var(--shadow);
    animation: toast-in .22s ease;
    pointer-events: auto;
    word-break: break-word;
}

.toast.is-ok {
    border-color: rgba(55, 217, 154, .5);
}

.toast.is-err {
    border-color: rgba(255, 107, 129, .5);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   落地页
   -------------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 46px 0 8px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    color: #e5ccff;
    background: var(--grad-soft);
    border: 1px solid rgba(196, 85, 255, .3);
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.18;
    margin-bottom: 18px;
    letter-spacing: -.5px;
}

.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    color: var(--muted);
    max-width: 680px;
    margin: 0 auto 26px;
    font-size: 15.5px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 44px;
    flex-wrap: wrap;
}

.hero-stats .stat {
    text-align: center;
}

.hero-stats b {
    display: block;
    font-size: 26px;
    color: #fff;
}

.hero-stats span {
    color: var(--muted);
    font-size: 12.5px;
}

.cta-band {
    margin-top: 46px;
    padding: 30px 32px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(196, 85, 255, .16));
    border: 1px solid rgba(196, 85, 255, .32);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-band h2 {
    font-size: 21px;
    margin-bottom: 6px;
}

.cta-band p {
    color: #d6d2f5;
    margin: 0;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   登录 / 注册
   -------------------------------------------------------------------------- */
.auth-wrap {
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding-top: 20px;
}

.auth-wrap-admin {
    grid-template-columns: minmax(0, 460px);
    justify-content: center;
}

.auth-card {
    padding: 30px;
}

.auth-card:hover {
    transform: none;
}

.auth-title {
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-sub {
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 22px;
}

.auth-foot {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    text-align: center;
}

.auth-aside {
    padding: 26px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
}

.auth-aside h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

.aside-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    color: var(--muted);
    font-size: 13.5px;
}

.aside-list li {
    position: relative;
    padding-left: 18px;
}

.aside-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--grad);
}

.aside-list b {
    color: var(--text);
}

/* 功能页布局 */
.app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.aside-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tips-card {
    padding: 20px;
}

.tips-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.footer {
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding: 22px;
    margin-top: 20px;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12.5px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

/* --------------------------------------------------------------------------
   响应式：900px 以下单列
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .row-2,
    .row-3,
    .auth-wrap,
    .app-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .page {
        padding: 24px 16px 60px;
    }

    .nav {
        height: auto;
        padding: 12px 0;
    }

    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .page-head {
        flex-direction: column;
    }

    .balance-card {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item .input {
        min-width: 0;
    }

    .filter-actions {
        margin-left: 0;
    }

    .filter-actions .btn {
        flex: 1;
    }

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

    .hero {
        padding-top: 26px;
    }

    .hero-stats {
        gap: 26px;
    }

    .cta-band {
        padding: 24px 20px;
        text-align: left;
    }

    .card {
        padding: 18px;
    }

    .form-card {
        padding: 18px;
    }

    .balance-value-lg {
        font-size: 36px;
    }

    .toast-wrap {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: none;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .input-xs,
    .input-sm {
        width: 100%;
    }
}

/* ==========================================================================
   增量扩充：运营能力（A7W 算力 / 存储 / 短信 / 支付 / 充值套餐）
   —— 全部沿用上方的颜色变量与卡片语言，不引入新的设计体系
   ========================================================================== */

/* --------------------------------------------------------------------------
   提示条
   -------------------------------------------------------------------------- */
.notice {
    display: block;
    margin: 0 0 20px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}

.notice.is-ok {
    border-color: rgba(55, 217, 154, .45);
    background: rgba(55, 217, 154, .1);
}

.notice.is-err {
    border-color: rgba(255, 107, 129, .45);
    background: rgba(255, 107, 129, .1);
}

.notice.is-info {
    border-color: rgba(124, 92, 255, .45);
    background: var(--grad-soft);
}

/* 温和提示（黄）：平台算力维护中这类「不是你的错，但暂时做不了」的提示 */
.notice.is-warn {
    border-color: rgba(255, 198, 92, .45);
    background: rgba(255, 198, 92, .1);
}

/* --------------------------------------------------------------------------
   后台「设置 → A7W 算力」：定时任务配置步骤
   -------------------------------------------------------------------------- */
.cron-steps {
    margin: 10px 0 0;
    padding-left: 22px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--muted);
}

.cron-steps b,
.cron-steps code {
    color: var(--text);
}

/* --------------------------------------------------------------------------
   二级标签（后台「设置」的 6 个子标签）
   -------------------------------------------------------------------------- */
.subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
    padding: 6px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}

.subtab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color .18s ease, background .18s ease;
}

.subtab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .05);
}

.subtab.is-active {
    color: #fff;
    background: var(--grad);
    box-shadow: 0 8px 22px rgba(124, 92, 255, .3);
}

/* --------------------------------------------------------------------------
   A7W 算力：概览大卡片
   -------------------------------------------------------------------------- */
.a7w-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    border-left: 3px solid var(--warn);
}

.a7w-card.is-ok {
    border-left-color: var(--ok);
}

.a7w-card.is-warn {
    border-left-color: var(--warn);
}

/* 未配置 Key：红色告警态 */
.a7w-card.is-error {
    border-left-color: var(--danger);
}

.a7w-card.is-error .a7w-card-value {
    background: none;
    color: var(--danger);
    -webkit-text-fill-color: currentColor;
}

/* 大字余额 + 单位 */
.a7w-card-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.a7w-card-unit {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.a7w-card-unit[hidden],
.a7w-card-sub[hidden] {
    display: none;
}

.a7w-card-sub .badge {
    margin-right: 6px;
    vertical-align: middle;
}

.a7w-card-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.a7w-card-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.5px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.a7w-card.has-error .a7w-card-value,
.a7w-card.is-warn .a7w-card-value {
    background: none;
    color: var(--warn);
    -webkit-text-fill-color: currentColor;
}

.a7w-card-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.a7w-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.a7w-result {
    grid-column: 1 / -1;
    margin: 6px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    font-size: 13px;
    line-height: 1.7;
    word-break: break-all;
}

/* --------------------------------------------------------------------------
   前台充值页：平台算力状态条
   -------------------------------------------------------------------------- */
.a7w-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, .04);
    font-size: 13px;
    line-height: 1.7;
}

.a7w-status b {
    display: block;
    font-size: 14px;
}

.a7w-status-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--muted);
}

.a7w-status.is-ok {
    border-color: rgba(55, 217, 154, .4);
}

.a7w-status.is-ok .a7w-status-dot {
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(55, 217, 154, .16);
}

.a7w-status.is-warn {
    border-color: rgba(255, 198, 92, .45);
    background: rgba(255, 198, 92, .08);
}

.a7w-status.is-warn .a7w-status-dot {
    background: var(--warn);
    box-shadow: 0 0 0 4px rgba(255, 198, 92, .16);
}

/* --------------------------------------------------------------------------
   充值套餐卡片
   -------------------------------------------------------------------------- */
.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 6px 0 20px;
}

.pkg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 16px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.pkg-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.pkg-card.is-active {
    border-color: var(--primary);
    background: var(--grad-soft);
    box-shadow: 0 14px 34px rgba(124, 92, 255, .22);
}

.pkg-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pkg-amount {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--text);
}

.pkg-points {
    font-size: 15px;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.pkg-meta {
    color: var(--muted);
    font-size: 12px;
}

.pkg-tag,
.pkg-save {
    position: absolute;
    top: -10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.pkg-tag {
    left: 14px;
    color: #fff;
    background: var(--grad);
}

.pkg-save {
    right: 14px;
    color: #08121a;
    background: var(--ok);
}

.pay-summary {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px dashed var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .03);
}

.pay-summary .price-row:last-child {
    border-bottom: 0;
}

/* --------------------------------------------------------------------------
   支付方式
   -------------------------------------------------------------------------- */
.pay-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pay-method {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .035);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.pay-method.is-active {
    border-color: var(--primary);
    background: var(--grad-soft);
    color: var(--text);
}

/* --------------------------------------------------------------------------
   收款二维码
   -------------------------------------------------------------------------- */
.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 16px 0 4px;
    padding: 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
}

.qr-img {
    width: 200px;
    height: 200px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

.pay-closed {
    text-align: left;
}

/* --------------------------------------------------------------------------
   下单结果
   -------------------------------------------------------------------------- */
.order-result {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(55, 217, 154, .4);
    border-radius: var(--radius-sm);
    background: rgba(55, 217, 154, .08);
}

.order-result[hidden] {
    display: none;
}

.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   短信验证码行
   -------------------------------------------------------------------------- */
.code-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.code-row .input {
    flex: 1 1 auto;
    min-width: 0;
}

.code-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   自检结果 / 驱动块 / 套餐编辑器
   -------------------------------------------------------------------------- */
.test-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.test-result {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    font-size: 13px;
    line-height: 1.75;
    word-break: break-all;
    white-space: pre-wrap;
}

.test-result[hidden] {
    display: none;
}

.test-result.is-ok {
    border-color: rgba(55, 217, 154, .45);
    background: rgba(55, 217, 154, .1);
}

.test-result.is-err {
    border-color: rgba(255, 107, 129, .45);
    background: rgba(255, 107, 129, .1);
}

.driver-block {
    padding: 14px 16px;
    margin: 4px 0 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .03);
}

.driver-block[hidden] {
    display: none;
}

.driver-block h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.package-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
    padding: 14px 16px 10px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .035);
}

.package-row .field {
    margin-bottom: 6px;
}

.package-row-foot {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px dashed var(--card-border);
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   后台订单详情（<details> 就地展开）
   -------------------------------------------------------------------------- */
.cell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.order-detail {
    width: 100%;
    margin-top: 6px;
    font-size: 12px;
}

.order-detail summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 600;
    list-style: none;
}

.order-detail summary::-webkit-details-marker {
    display: none;
}

.order-detail summary::before {
    content: '▸ ';
}

.order-detail[open] summary::before {
    content: '▾ ';
}

.order-detail-body {
    margin-top: 10px;
    padding: 12px;
    min-width: 260px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
}

.order-raw pre {
    margin: 6px 0 0;
    max-height: 160px;
    overflow: auto;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .3);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --------------------------------------------------------------------------
   掩码 / 等宽展示（密钥、回调地址）
   -------------------------------------------------------------------------- */
.masked {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}

@media (max-width: 900px) {
    .a7w-card {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .qr-img {
        width: 100%;
        max-width: 240px;
        height: auto;
    }

    .code-row {
        flex-direction: column;
    }

    .code-row .btn {
        width: 100%;
    }

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