/* ==========================================================
   ONEAIART 全站暗色主题层（v107）
   - 与创作页 create.html 的暗色令牌一致（oaa-theme 互通）
   - 变量驱动页（app/styles.css、index、login、register、recharge）
     走变量覆盖；硬编码页（gallery、history、settings）走选择器覆盖
   - admin.html / admin-login.html / upload_test.html 本就是暗色设计，
     不接入本文件
   ========================================================== */

/* ---------- 基础 ---------- */
html[data-theme="dark"]{
  color-scheme:dark;
}
html[data-theme="dark"] body{
  background:#0f1117;
  color:#eef1f6;
}

/* ---------- 主题切换按钮（与创作页 .theme-toggle 同款） ---------- */
.theme-toggle{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e2e8f0;border-radius:10px;background:transparent;cursor:pointer;font-size:16px;transition:all .15s;color:#475569;flex-shrink:0}
.theme-toggle:hover{border-color:#6366f1;color:#6366f1}
html[data-theme="dark"] .theme-toggle{border-color:#262b38;color:#a6adbc}
html[data-theme="dark"] .theme-toggle:hover{border-color:#5b7cfa;color:#5b7cfa}
/* 无导航页（login/register/recharge）右上角浮动 */
.theme-toggle-float{position:fixed;top:18px;right:18px;z-index:900;background:rgba(255,255,255,.75);backdrop-filter:blur(8px)}
html[data-theme="dark"] .theme-toggle-float{background:rgba(23,26,34,.75)}

/* ==========================================================
   app.html —— 共享设计系统 /css/styles.css 变量覆盖
   ========================================================== */
html[data-theme="dark"]{
  --color-bg:#0f1117;
  --color-bg-alt:#161a23;
  --color-white:#171a22;                 /* 23 处卡片/输入面背景 */
  --color-border:#262b38;
  --color-border-light:#202634;
  --color-text:#eef1f6;
  --color-text-secondary:#a6adbc;
  --color-text-muted:#69707f;
  --color-primary-bg:#1d2438;            /* 靛蓝软底 */
  --color-primary-dark:#a5b4fc;          /* 深靛在暗色下转亮靛（文字/渐变） */
  --color-success-bg:rgba(52,211,153,.12);
  --color-warning-bg:rgba(245,158,11,.1);
  --color-error-bg:rgba(239,68,68,.12);
  --color-info-bg:rgba(59,130,246,.12);
}
/* --color-white 翻转后唯一一处文字用法补丁（成功色按钮 hover 文字保持白） */
html[data-theme="dark"] .placeholder-actions .btn-publish-single:hover{color:#fff}

/* ==========================================================
   index.html —— 自有变量（--ink/--bg/--card/--border 等）
   ========================================================== */
html[data-theme="dark"]{
  --ink:#eef1f6; --ink2:#a6adbc; --ink3:#69707f;
  --bg:#0f1117; --bg2:#12151d; --bg3:#1a1e29;
  --card:#171a22; --border:#262b38;
  --shadow:0 1px 3px rgba(0,0,0,.4);
  --shadow-lg:0 20px 60px rgba(0,0,0,.45);
}
html[data-theme="dark"] .nav{background:rgba(15,17,23,.85);border-bottom-color:#262b38}
/* [v109] 三步电商流程段：原渐变尾部硬编码 #eef2ff 浅靛，暗色下刺眼 */
html[data-theme="dark"] .flow{background:linear-gradient(180deg,#12151d 0%,#0f1117 100%)}
html[data-theme="dark"] .showcase-item{background:#171a22}
html[data-theme="dark"] .showcase-thumb{background:linear-gradient(135deg,rgba(99,102,241,.14),rgba(139,92,246,.18))}

/* ==========================================================
   login.html / register.html / recharge.html —— 同一套变量
   （--canvas/--ink/--surface/--surface-input/--hairline/--primary-soft）
   ========================================================== */
html[data-theme="dark"]{
  --canvas:#0f1117;
  --ink:#eef1f6;
  --ink-soft:#a6adbc;
  --ink-muted:#69707f;
  --surface:#171a22;
  --surface-input:#1f2330;
  --hairline:#262b38;
  --primary-soft:rgba(91,124,250,.16);
  --shadow-md:0 4px 16px rgba(0,0,0,.45);
  --shadow-xl:0 20px 60px rgba(0,0,0,.5);
}
/* 输入框 focus 硬编码白底修正 */
html[data-theme="dark"] .f-input:focus,
html[data-theme="dark"] .inp:focus{background:#1f2330}
/* 注册页次按钮 */
html[data-theme="dark"] .btn-secondary{background:#1f2330;color:#eef1f6}
html[data-theme="dark"] .btn-secondary:hover{background:#262b38}
/* 充值页状态徽章：浅色粉彩 → 暗色半透明 */
html[data-theme="dark"] .status.pending{background:rgba(245,158,11,.12);color:#fbbf24}
html[data-theme="dark"] .status.completed{background:rgba(52,211,153,.12);color:#34d399}
html[data-theme="dark"] .status.waiting{background:rgba(99,102,241,.16);color:#a5b4fc}
html[data-theme="dark"] .pending-banner{background:rgba(245,158,11,.08)}
html[data-theme="dark"] .banner-title{color:#fbbf24}
html[data-theme="dark"] .banner-sub{color:#e0a53f}
html[data-theme="dark"] .success-title{color:#34d399}

/* ==========================================================
   gallery.html —— 硬编码浅色选择器覆盖
   ========================================================== */
html[data-theme="dark"] .nav{background:rgba(15,17,23,.85);border-bottom-color:#262b38}
html[data-theme="dark"] .nav-name{color:#eef1f6}
html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .nav-item{color:#a6adbc}
html[data-theme="dark"] .nav-item.active{background:rgba(91,124,250,.16)}
html[data-theme="dark"] .btn-ghost{color:#eef1f6;border-color:#262b38}
html[data-theme="dark"] .gallery-card{background:#171a22;border-color:#262b38}
html[data-theme="dark"] .gallery-card .info{color:#a6adbc}
html[data-theme="dark"] .gallery-card:hover{box-shadow:0 4px 16px rgba(0,0,0,.5)}
html[data-theme="dark"] .empty-hint{color:#69707f}
html[data-theme="dark"] .pagination button{background:#171a22;color:#a6adbc;border-color:#262b38}
html[data-theme="dark"] .pagination span{color:#69707f}

/* ==========================================================
   history.html —— 硬编码浅色选择器覆盖
   ========================================================== */
html[data-theme="dark"] .nav{background:rgba(15,17,23,.85);border-bottom-color:#262b38}
html[data-theme="dark"] .nav-name{color:#eef1f6}
html[data-theme="dark"] .nav-links a{color:#a6adbc}
html[data-theme="dark"] .btn-ghost{color:#eef1f6;border-color:#262b38}
html[data-theme="dark"] .card{background:#171a22;border-color:#262b38}
html[data-theme="dark"] .card:hover{box-shadow:0 4px 16px rgba(0,0,0,.5)}
html[data-theme="dark"] .card .meta{color:#8b93a5}
html[data-theme="dark"] .empty{color:#69707f}
html[data-theme="dark"] .spin{border-color:#262b38;border-top-color:#5b7cfa}
html[data-theme="dark"] .detail{border-top-color:#262b38}
/* 状态徽章：浅色粉彩 → 暗色半透明 */
html[data-theme="dark"] .st.ok{background:rgba(52,211,153,.12);color:#34d399}
html[data-theme="dark"] .st.ing{background:rgba(59,130,246,.14);color:#60a5fa}
html[data-theme="dark"] .st.wait{background:rgba(245,158,11,.12);color:#fbbf24}
html[data-theme="dark"] .st.fail{background:rgba(239,68,68,.12);color:#f87171}

/* ==========================================================
   settings.html —— 硬编码浅色选择器覆盖
   ========================================================== */
html[data-theme="dark"] .nav{background:rgba(15,17,23,.85);border-bottom-color:#262b38}
html[data-theme="dark"] .nav-name{color:#eef1f6}
html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .nav-item{color:#a6adbc}
html[data-theme="dark"] .btn-ghost{color:#eef1f6;border-color:#262b38}
html[data-theme="dark"] .settings-form{background:#171a22;border-color:#262b38}
html[data-theme="dark"] .settings-form label{color:#a6adbc}
html[data-theme="dark"] .settings-form input{background:#1f2330;border-color:#262b38;color:#eef1f6}
html[data-theme="dark"] .settings-form input:disabled{background:#161a23;color:#69707f}
