/* ============================================================
   下载站主题（仅下载站页面加载）
   深浅色令牌 / 页面背景 / 浅色覆盖 / 主题切换按钮
   只改这个文件，不会影响导航站与维护页
   ============================================================ */

/* ---------- 默认（深色）令牌 ---------- */
:root{
  --accent:#ff9f43;
  --accent2:#ff6b35;
  --bg-deep:#0a0e27;
  --bg-mid:#1a1a2e;
  --bg-end:#16213e;
  --text-1:#fff;
  --text-2:rgba(255,255,255,0.7);
  --text-3:rgba(255,255,255,0.5);
}

/* ---------- 页面背景（模板可覆盖 body 背景） ---------- */
body.page-download{
  background:radial-gradient(ellipse at 85% 90%,rgba(255,159,67,0.18) 0%,rgba(255,107,53,0.08) 25%,transparent 55%),radial-gradient(ellipse at 15% 10%,rgba(99,102,241,0.12) 0%,transparent 45%),linear-gradient(160deg,var(--bg-deep) 0%,var(--bg-mid) 55%,var(--bg-end) 100%);
  color:#fff;
}

/* ---------- 桌面右下角主题切换按钮 ---------- */
.theme-toggle{position:fixed;right:18px;bottom:18px;z-index:9997;width:44px;height:44px;border-radius:50%;border:1px solid rgba(255,255,255,.16);background:rgba(20,24,45,.82);color:#fff;font-size:19px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 8px 24px rgba(0,0,0,.3);transition:transform .2s,background .2s}
.theme-toggle:hover{transform:translateY(-2px)}
.theme-toggle .theme-icon-light{display:none}
html[data-theme="light"] .theme-toggle{background:rgba(255,255,255,.92);color:#0f172a;border-color:rgba(15,23,42,.12)}
html[data-theme="light"] .theme-toggle .theme-icon-dark{display:none}
html[data-theme="light"] .theme-toggle .theme-icon-light{display:inline}
html[data-theme="light"] .theme-toggle:hover{box-shadow:0 10px 26px rgba(15,23,42,.16)}

/* ---------- 手机版页头主题切换按钮 ---------- */
[data-theme-switch]{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border-radius:50%;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:inherit;font-size:16px;line-height:1;cursor:pointer;transition:background .2s,border-color .2s}
[data-theme-switch]:hover{background:rgba(255,255,255,.16)}
[data-theme-switch] .theme-icon-light{display:none}
html[data-theme="light"] [data-theme-switch]{border-color:rgba(15,23,42,.14);background:rgba(15,23,42,.05)}
html[data-theme="light"] [data-theme-switch]:hover{background:rgba(15,23,42,.1)}
html[data-theme="light"] [data-theme-switch] .theme-icon-dark{display:none}
html[data-theme="light"] [data-theme-switch] .theme-icon-light{display:inline}

/* ---------- 弹窗正文 ---------- */
.pcontent{color:rgba(255,255,255,0.85)}
html[data-theme="light"] .pcontent{color:#334155}

/* ---------- 浅色主题覆盖 ---------- */
html[data-theme="light"]{
  --bg-deep:#f5f7fb;--bg-mid:#ffffff;--bg-end:#eef2f8;
  --text-1:#0f172a;--text-2:#475569;--text-3:#64748b;
}
:where(html[data-theme="light"]) body.page-download{color:#0f172a;background:radial-gradient(ellipse at 85% 90%,rgba(255,159,67,.12) 0%,transparent 55%),radial-gradient(ellipse at 15% 10%,rgba(99,102,241,.08) 0%,transparent 45%),linear-gradient(160deg,#f8fafd 0%,#eef2f8 100%)}
html[data-theme="light"] .shot-dots i{background:rgba(15,23,42,.22)}
html[data-theme="light"] .puzzle-track{background:rgba(15,23,42,.08);border-color:rgba(15,23,42,.18)}
html[data-theme="light"] .puzzle-status{color:#64748b}
html[data-theme="light"] .guide-section,html[data-theme="light"] .appnote-section{background:rgba(255,255,255,.88);border-color:rgba(15,23,42,.08);box-shadow:0 10px 30px rgba(15,23,42,.06)}
html[data-theme="light"] .guide-section .section-label,html[data-theme="light"] .appnote-section .section-label{color:#0f172a}
html[data-theme="light"] .guide-section .section-desc,html[data-theme="light"] .appnote-section .section-desc{color:#64748b}
html[data-theme="light"] .guide-step,html[data-theme="light"] .appnote-step{color:#334155}
html[data-theme="light"] .guide-step .tag,html[data-theme="light"] .appnote-step .safe,html[data-theme="light"] .appnote-step .highlight-yellow{background:rgba(249,115,22,.12);color:#c2410c}
html[data-theme="light"] .guide-tab{background:rgba(15,23,42,.05);color:#475569}
html[data-theme="light"] .guide-tab.active{background:rgba(249,115,22,.14);color:#c2410c;border-color:rgba(249,115,22,.2)}
html[data-theme="light"] .guide-tab:hover:not(.active){background:rgba(15,23,42,.09);color:#0f172a}
html[data-theme="light"] .tv-model-tabs{background:rgba(15,23,42,.03);border-color:rgba(15,23,42,.06)}
html[data-theme="light"] .tv-model-tab{background:rgba(15,23,42,.05);color:#475569}
html[data-theme="light"] .tv-model-tab.active{background:rgba(249,115,22,.14);color:#c2410c;border-color:rgba(249,115,22,.2)}
html[data-theme="light"] .nav-item{color:#64748b}
html[data-theme="light"] .nav-item:hover{color:#0f172a;background:rgba(15,23,42,.04)}
html[data-theme="light"] .nav-item.active{color:#c2410c;background:linear-gradient(90deg,rgba(249,115,22,.12) 0%,transparent 100%)}
html[data-theme="light"] .nav-item.active .nav-text{color:#c2410c}
html[data-theme="light"] .footer-tip{background:rgba(249,115,22,.07);border-color:rgba(249,115,22,.16)}
html[data-theme="light"] .footer-tip .tip-body{color:#475569}
html[data-theme="light"] .contact-item{background:rgba(255,255,255,.9);border-color:rgba(15,23,42,.1);color:#334155}
html[data-theme="light"] .friend-links a{color:#64748b}
html[data-theme="light"] .friend-links a:hover{color:#c2410c}
html[data-theme="light"] .mobile-tabs-inline{border-color:rgba(15,23,42,.1);background:rgba(255,255,255,.85)}
html[data-theme="light"] .mobile-tabs-inline .mobile-tab{color:#64748b}
html[data-theme="light"] .mobile-tabs-inline .mobile-tab.active{background:rgba(249,115,22,.14);color:#c2410c}
html[data-theme="light"] .mobile-tabs-inline .mobile-tab:hover:not(.active){background:rgba(15,23,42,.06);color:#0f172a}
html[data-theme="light"] .warning-badge{background:rgba(249,115,22,.1);border-color:rgba(249,115,22,.25);color:#c2410c}
html[data-theme="light"] .warning-badge img{filter:none!important}
html[data-theme="light"] .vcard{background:#fff;border-color:rgba(249,115,22,.25);color:#0f172a;box-shadow:0 24px 60px rgba(15,23,42,.2)}
html[data-theme="light"] .vcard h3{color:#c2410c}
html[data-theme="light"] .vcard input{background:#f8fafc;border-color:rgba(15,23,42,.15);color:#0f172a}
html[data-theme="light"] .vcard .vclose{color:#64748b}
html[data-theme="light"] .vopt{background:#f8fafc;border-color:rgba(15,23,42,.15);color:#0f172a}
html[data-theme="light"] .vopt.sel{background:rgba(249,115,22,.12);border-color:#f97316}
html[data-theme="light"] .video-wrapper{background:rgba(15,23,42,.03);border-color:rgba(15,23,42,.08)}
html[data-theme="light"] .video-tip{color:#64748b}
html[data-theme="light"] .phone-mockup,html[data-theme="light"] .tv-frame{box-shadow:0 30px 60px rgba(15,23,42,.18),0 0 0 2px rgba(15,23,42,.06)}
html[data-theme="light"] .official-badge{color:#fff}
html[data-theme="light"] .gradient-text,
html[data-theme="light"] .hero-title,
html[data-theme="light"] .gold-gradient-text{color:#0e1730;background:none;-webkit-text-fill-color:currentColor}
html[data-theme="light"] #version-text{color:#0e1730}
html[data-theme="light"] .desktop-nav .nav-item img{filter:none!important}
html[data-theme="light"] .phone-mockup{background:linear-gradient(145deg,#e6ebf4,#cfd8e6);box-shadow:0 30px 60px rgba(15,23,42,.16),0 0 0 2px rgba(15,23,42,.06)}
html[data-theme="light"] .phone-screen{background:#f1f5f9}
html[data-theme="light"] .platform-tabs,
html[data-theme="light"] .mobile-tabs-inline{background:rgba(255,255,255,.9);border-color:rgba(15,23,42,.1)}
html[data-theme="light"] .platform-tab,
html[data-theme="light"] .mobile-tab{color:#475569}
html[data-theme="light"] .platform-tab.active,
html[data-theme="light"] .mobile-tab.active{color:#c2410c}

/* ============================================================
   应用下载卡的小标签（贴片 / 角标）— 2026-11 新增
   ------------------------------------------------------------
   结构由 includes/template-helpers.php 的 tpl_app_tag() 输出，类名固定：
     .tp-app-tag                 基础贴片
     .tp-app-tag--inline         名称右侧的小贴片（电脑端默认、手机端固定）
     .tp-app-tag--corner         卡片右上角角标（仅电脑端，后台按应用单独开启）
     .tp-app-tag--blackgold|ruby|sapphire|amethyst|silver|rosegold|champagne
                                 颜色档位（2026-11 升级为 7 档高级渐变）
   所有档位都是 135° 斜向纯线性渐变，不再引用模板强调色，五套模板显示完全一致。
   浅色档位（银灰 / 玫瑰金 / 香槟金）改用深色字，其余用白字；黑金用金色字并带呼吸动效。
   注意：不要在这里写 position:relative / overflow 之类会影响卡片布局的规则，
   卡片自身的定位与圆角仍由各模板原有样式决定。
   ============================================================ */
.tp-app-tag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  max-width:86px;                 /* 6 个字 + 内边距的上限，防止窄卡片被撑破 */
  padding:2px 7px;
  border-radius:5px;              /* 小方角贴片，比胶囊更“贴纸” */
  font-family:inherit;
  font-size:11px;
  font-weight:700;
  line-height:16px;
  letter-spacing:.02em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#fff;
  text-decoration:none;
  text-shadow:0 1px 1px rgba(0,0,0,.18);   /* 浅色底上也能压住白字 */
  background:#98a5b8;                     /* 兜底底色，正常都会被下面的颜色档位覆盖 */
  box-shadow:0 2px 6px rgba(0,0,0,.18);
  -webkit-font-smoothing:antialiased;
}

/* 电脑端可选：贴在卡片右上角。top 取负值让贴片跨在卡片上边缘，形成角标的观感；
   卡片需要 position:relative（由各模板补，nebula/aurora 原本就有）。
   只有后台把该应用的「电脑端位置」选成卡片右上角时才会输出这个类。 */
.tp-app-tag--corner{
  position:absolute;
  top:-8px;                /* 卡片列表间距最小 10px，向上 8px 仍留 2px 余量，不会压到上一张卡 */
  right:12px;
  z-index:6;
}

/* 名称右侧：电脑端默认与手机端完全一致。这里用 margin-left 而不是 flex gap，
   兼容 2020 年 Chrome 80-83 / Safari 13 不支持 flex gap 的情况 */
.tp-app-tag--inline{
  position:static;
  flex:0 0 auto;
  margin-left:6px;
  vertical-align:middle;
}

/* 「名称 + 贴片」这一行的通用容器（五套模板的电脑端与手机端共用） */
.tp-dl-name-row{
  display:flex;
  align-items:center;
  min-width:0;
}
.tp-dl-name-row>strong,
.tp-dl-name-row>.tp-dl-name{
  flex:0 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* 高优先级重置：sunrise / tide 的 .{模板}-dl-info span、aurora 的 .aurora-download-text span
   会命中标签 <span>，把字号、颜色、display、margin-top 改掉（角标还会被 display:block 影响）。
   这里用 0,2,0 的选择器统一压回去，保证贴片在五套模板里看起来完全一致 */
.tp-dl-name-row .tp-app-tag{
  display:inline-flex;
  margin-top:0;
  font-size:11px;
  color:#fff;
}

/* ---------- 颜色档位（2026-11 升级：7 档高级纯线性渐变，135° 斜向受光） ----------
   深色渐变配白字，浅色渐变配深色字；黑金配金色字并带“明暗呼吸 + 光泽流动”。
   五套模板共用同一套色值，后台预览与前台严格一一对应（改色值时两处要同步）。
   注意：不要新增 ::before / ::after，标签上可能有链接或角标定位，多余的伪元素会串层。 */
.tp-app-tag--ruby{background:linear-gradient(135deg,#ffb3c1 0%,#e0355f 52%,#8e0c3a 100%)}
.tp-app-tag--sapphire{background:linear-gradient(135deg,#a9c9ff 0%,#2f6fe4 52%,#12307d 100%)}
.tp-app-tag--amethyst{background:linear-gradient(135deg,#e0c8ff 0%,#8b5cf6 52%,#4b1d95 100%)}
.tp-app-tag--silver{background:linear-gradient(135deg,#f8fafc 0%,#d5dee9 50%,#98a5b8 100%)}
.tp-app-tag--rosegold{background:linear-gradient(135deg,#ffe3d8 0%,#f0b4a1 50%,#c98a78 100%)}
.tp-app-tag--champagne{background:linear-gradient(135deg,#fff6da 0%,#f3dca6 50%,#d9bb72 100%)}
.tp-app-tag--blackgold{
  background-color:#17120c;
  background-image:
    linear-gradient(115deg,rgba(255,226,160,0) 38%,rgba(255,226,160,.42) 50%,rgba(255,226,160,0) 62%),
    linear-gradient(135deg,#3a2b1a 0%,#17120c 52%,#3a2b1a 100%);
  background-size:200% 100%,100% 100%;
  background-position:0% 0,0 0;
  background-repeat:no-repeat;
  color:#f5d98b;
  text-shadow:0 1px 2px rgba(0,0,0,.55);
  box-shadow:inset 0 0 0 1px #e0b45e,0 2px 6px rgba(0,0,0,.2);
  animation:xk-tag-blackgold-breathe 4s ease-in-out infinite;
}
@keyframes xk-tag-blackgold-breathe{
  0%,100%{background-position:0% 0,0 0;filter:brightness(1)}
  45%{background-position:100% 0,0 0;filter:brightness(1.26)}
  60%{background-position:100% 0,0 0;filter:brightness(1.3)}
}
@media (prefers-reduced-motion: reduce){
  .tp-app-tag--blackgold{animation:none}
}

/* 浅色档位改用深色字：上面的 0,2,0 重置默认给白字，这里必须同权重覆盖 */
.tp-dl-name-row .tp-app-tag--silver{color:#2b3648;text-shadow:0 1px 0 rgba(255,255,255,.45)}
.tp-dl-name-row .tp-app-tag--rosegold{color:#5a2b26;text-shadow:0 1px 0 rgba(255,255,255,.35)}
.tp-dl-name-row .tp-app-tag--champagne{color:#4a3413;text-shadow:0 1px 0 rgba(255,255,255,.35)}
.tp-dl-name-row .tp-app-tag--blackgold{color:#f5d98b}

/* 链接型标签：可点击，但保持贴片外观（不能出现下划线） */
a.tp-app-tag{border-bottom:0}
a.tp-app-tag:hover{filter:brightness(1.06)}

/* 2026-11 调整：除黑金外全部改为静态贴片。
   黑金只作为“最高档”保留明暗呼吸 + 光泽流动，其余档位保持克制，避免首屏多个标签同时闪。
   动效已加 prefers-reduced-motion 降级：系统开启“减少动态效果”时黑金也会静止。 */

/* 窄卡片自动避让：main.js 会给宽度不足的 .tp-dl-item 加上 tp-tag-fit-inline，
   此时角标退回名称右侧，绝不压住应用名和下载按钮 */
.tp-tag-fit-inline .tp-app-tag--corner{
  position:static;
  top:auto;
  right:auto;
  z-index:auto;
  flex:0 0 auto;
  margin-left:6px;
}

/* 浅色主题下贴片本身颜色不变（渐变底在浅底上同样清晰），仅把阴影调浅一点，避免在白色卡片上显脏 */
html[data-theme="light"] .tp-app-tag--corner{box-shadow:0 2px 8px rgba(15,23,42,.16)}
html[data-theme="light"] .tp-app-tag--inline{box-shadow:0 1px 4px rgba(15,23,42,.14)}
/* 黑金的金色细边不能被上面的浅色主题阴影覆盖 */
html[data-theme="light"] .tp-app-tag--corner.tp-app-tag--blackgold,
html[data-theme="light"] .tp-app-tag--inline.tp-app-tag--blackgold{
  box-shadow:inset 0 0 0 1px #e0b45e,0 2px 6px rgba(15,23,42,.2);
}
