/* ========== QF AUTH · 浅色磨砂主题（参考 yunkong.nanqiai.top） ========== */
:root{
  --color-bg: #eee;
  --color-primary: #1f2937;
  --color-secondary: #7b888e;
  --color-border: #ffffff;
  --color-brand: #35bfab;
  --color-brand-2: #1fc9e7;
  --color-card: rgba(255,255,255,0.40);
  --color-card-strong: rgba(255,255,255,0.62);
  --color-danger:#ef5b6e;
  --color-success:#22a06b;
  --shadow-card: 0 10px 30px rgba(31,41,55,.10), inset 0 1px 0 rgba(255,255,255,.6);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--color-primary);
  background: var(--color-bg);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  position:relative;
}

/* Subtle dark→gray gradient overlay like reference */
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background: linear-gradient(to right bottom, rgba(0,0,0,.20) 0%, rgba(170,170,170,.08) 100%);
}

/* Floating colorful bubbles (decorative, blurred) */
.bubbles{ position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden; }
.bubble{
  position:absolute;border-radius:50%;
  filter: blur(60px); opacity:.55; mix-blend-mode:multiply;
  animation: float-bubble 14s ease-in-out infinite alternate;
}
.bubble.b1{ width:380px;height:380px; left:-60px; top:-60px;
  background: radial-gradient(circle,#7be3d4,#35bfab 70%); }
.bubble.b2{ width:460px;height:460px; right:-120px; top:8%;
  background: radial-gradient(circle,#9ae8f5,#1fc9e7 70%); animation-delay:-4s; }
.bubble.b3{ width:420px;height:420px; left:18%; bottom:-140px;
  background: radial-gradient(circle,#ffd7a8,#ffa86b 70%); animation-delay:-7s; opacity:.45; }
.bubble.b4{ width:340px;height:340px; right:14%; bottom:-100px;
  background: radial-gradient(circle,#dbb6ff,#9c6bff 70%); animation-delay:-10s; opacity:.40; }

@keyframes float-bubble{
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(30px,-20px) scale(1.25); }
}

/* All page content above bubbles */
.center-wrap, .app-shell, .toast-wrap{ position:relative; z-index:1; }

/* ====== Glass primitives — frosted white ====== */
.glass{
  background: var(--color-card);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border:1px solid var(--color-border);
  border-radius:24px;
  box-shadow: var(--shadow-card);
  position:relative;
  overflow:hidden;
}
.glass-strong{ background: var(--color-card-strong); }

/* Subtle highlight ring for liquid feel */
.glass-ring{ position:relative; }
.glass-ring::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background: linear-gradient(135deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,0) 40%);
  mix-blend-mode: screen;
}

/* Hover lift for interactive cards */
.lift{ transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease; }
.lift:hover{ transform: translateY(-4px); box-shadow: 0 18px 40px rgba(31,41,55,.12), inset 0 1px 0 rgba(255,255,255,.6); }

/* Entrance animations */
@keyframes pop-in{ from{ opacity:0; transform: translateY(20px) scale(.96);} to{ opacity:1; transform: translateY(0) scale(1);} }
@keyframes fade-up{ from{ opacity:0; transform: translateY(10px);} to{ opacity:1; transform:translateY(0);} }
.anim-pop{ animation: pop-in .55s cubic-bezier(.2,.8,.2,1) both; }
.anim-fade{ animation: fade-up .5s ease both; }
.delay-1{ animation-delay:.08s } .delay-2{ animation-delay:.16s } .delay-3{ animation-delay:.24s } .delay-4{ animation-delay:.32s }

/* Quote crossfade */
.quote .text{ transition: opacity .4s ease; }
.quote .text.fading{ opacity:0; }

/* ====== Layout ====== */
.center-wrap{
  min-height:100dvh;
  display:flex;align-items:center;justify-content:center;
  padding:24px;
}
.app-shell{
  min-height:100dvh;
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:20px;
  padding:20px;
}
@media (max-width: 900px){
  .app-shell{ grid-template-columns: 1fr; }
}

.sidebar{ padding:18px; display:flex; flex-direction:column; gap:14px; }
.brand{ display:flex;align-items:center;gap:12px;padding:6px 4px; }
.brand-logo{
  width:46px;height:46px;border-radius:50%;
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-2));
  box-shadow: 0 8px 22px rgba(31,201,231,.30), inset 0 1px 0 rgba(255,255,255,.7);
  display:grid;place-items:center;color:#fff;font-weight:700;letter-spacing:.5px;
}
.brand-name{ font-weight:700; letter-spacing:.5px; color:var(--color-primary); }
.brand-sub{ font-size:12px; color:var(--color-secondary); }

.nav{ display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.nav-item{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:14px;cursor:pointer;
  color:var(--color-secondary);transition:all .25s ease;
  border:1px solid transparent;
}
.nav-item:hover{ color:var(--color-primary); background:rgba(255,255,255,.55); }
.nav-item.active{
  color:var(--color-primary);
  background:rgba(255,255,255,.75);
  border-color: rgba(255,255,255,1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 4px 14px rgba(31,41,55,.06);
}
.nav-item .dot{ width:8px;height:8px;border-radius:50%;background:var(--color-brand); box-shadow:0 0 10px rgba(53,191,171,.6); }

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

.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;
}
.topbar .title{ font-weight:700; font-size:18px; color:var(--color-primary); }
.user-chip{
  display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:999px;
  background:rgba(255,255,255,.65);border:1px solid #fff;
}
.avatar{
  width:30px;height:30px;border-radius:50%;
  background:linear-gradient(135deg,var(--color-brand),var(--color-brand-2));
  display:grid;place-items:center;color:#fff;font-weight:700;font-size:12px;
}

/* ====== Cards / panels ====== */
.panel{ padding:22px; }
.panel h3{ margin:0 0 12px; font-size:16px; letter-spacing:.3px; color:var(--color-primary); }
.panel .desc{ color:var(--color-secondary); font-size:13px; margin-bottom:16px; line-height:1.6; }

.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap:20px; }
@media (max-width: 900px){ .grid-2{ grid-template-columns: 1fr; } }

/* ====== Form controls ====== */
.field{ display:flex;flex-direction:column;gap:6px;margin-bottom:14px; }
.field label{ font-size:12px;color:var(--color-secondary); letter-spacing:.4px; }
.input, .textarea, .select{
  width:100%;
  background: rgba(255,255,255,.55);
  border:1px solid #fff;
  border-radius:16px;
  color:var(--color-primary);
  padding:12px 14px;
  font-size:14px;
  outline:none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family:inherit;
}
.input::placeholder,.textarea::placeholder{ color:#9aa5ab; }
.input:focus,.textarea:focus,.select:focus{
  border-color: color-mix(in oklab, var(--color-brand) 60%, transparent);
  background: rgba(255,255,255,.85);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-brand) 18%, transparent);
}
.textarea{ resize:vertical; min-height:120px; font-family: ui-monospace,Menlo,Consolas,monospace; }
.row{ display:flex;gap:10px;align-items:center; }
.row > *{ flex:1; }

/* Input with leading icon */
.input-icon{ position:relative; }
.input-icon .ico{
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  width:16px;height:16px; color:var(--color-secondary); pointer-events:none;
}
.input-icon .input{ padding-left:42px; }

/* Inline icon helper */
.icn{ width:16px;height:16px;flex:none; }
.icn-lg{ width:22px;height:22px; }

.btn{
  appearance:none;border:none;cursor:pointer;
  padding:12px 18px;border-radius:14px;font-size:14px;font-weight:600;
  color:#fff;
  background: linear-gradient(135deg,var(--color-brand),var(--color-brand-2));
  box-shadow: 0 8px 22px rgba(31,201,231,.28), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.btn:hover{ transform: translateY(-1px); filter:brightness(1.04); }
.btn:active{ transform: translateY(0); filter:brightness(.98); }
.btn.primary{
  background: linear-gradient(135deg,var(--color-brand),var(--color-brand-2));
}
.btn.ghost{
  background:rgba(255,255,255,.7); color:var(--color-primary);
  border:1px solid #fff;
  box-shadow: 0 4px 14px rgba(31,41,55,.06);
}
.btn.danger{
  background: linear-gradient(135deg,#ff8aa3,#ef5b6e); color:#fff;
}
.btn:disabled{ opacity:.6; cursor:not-allowed; transform:none; }

/* ====== Result blocks ====== */
.result{
  margin-top:14px; padding:14px; border-radius:16px;
  background: rgba(255,255,255,.7); border:1px solid #fff;
  font-family: ui-monospace,Menlo,Consolas,monospace;
  font-size:13px; color:#1f2937; word-break:break-all; white-space:pre-wrap;
  min-height:48px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.result.empty{ color:var(--color-secondary); }

.kbd{ font-family:ui-monospace,Menlo,Consolas,monospace; padding:2px 6px;border-radius:6px;background:rgba(0,0,0,.06);font-size:12px; }

/* ====== Quote bar ====== */
.quote{
  padding:16px 20px;
  display:flex;align-items:center;gap:14px;
  font-style:italic; color:var(--color-secondary); font-size:14px;
}
.quote .mark{
  width:36px;height:36px;border-radius:12px;display:grid;place-items:center;
  background: linear-gradient(135deg, color-mix(in oklab,var(--color-brand) 30%,white), color-mix(in oklab,var(--color-brand-2) 30%,white));
  color:var(--color-brand); font-weight:700;
  border:1px solid #fff;
}
.quote .text{ line-height:1.6; }

/* ====== Toast ====== */
.toast-wrap{ position:fixed; right:18px; top:18px; display:flex;flex-direction:column;gap:10px; z-index:100; }
.toast{
  padding:12px 16px; border-radius:14px; backdrop-filter:blur(20px);
  background:rgba(255,255,255,.85); border:1px solid #fff;
  color:var(--color-primary); font-size:13px;
  box-shadow:0 10px 30px rgba(31,41,55,.12);
  animation: slidein .3s ease;
}
.toast.success{ border-color: color-mix(in oklab, var(--color-success) 50%, white); }
.toast.error{ border-color: color-mix(in oklab, var(--color-danger) 50%, white); }
@keyframes slidein{ from{transform:translateX(20px);opacity:0} to{transform:translateX(0);opacity:1} }

/* ====== Login ====== */
.login-card{ width:100%; max-width:420px; padding:36px 32px; }
.login-card .field label{ text-align:left; }
.login-head-wrap{ text-align:center; }
.login-head{
  width:64px;height:64px;border-radius:50%;
  margin: 0 auto 14px;
  display:grid;place-items:center;color:#fff;
  background: linear-gradient(135deg,var(--color-brand),var(--color-brand-2));
  box-shadow: 0 12px 28px rgba(31,201,231,.35), inset 0 1px 0 rgba(255,255,255,.6);
}
.login-title{ font-size:22px; font-weight:700; margin:6px 0 4px; color:var(--color-primary); }
.login-sub{ color:var(--color-secondary); font-size:13px; margin-bottom:18px; }
.divider{ height:1px;background:rgba(31,41,55,.08); margin:18px 0; }
.foot-link{ color:var(--color-secondary); font-size:12px; text-align:center; }
.foot-link a{ color:var(--color-brand); text-decoration:none; }

/* Brand text gradient */
.brand-text{
  background: linear-gradient(135deg,var(--color-brand) 40%,var(--color-brand-2));
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
  font-weight:800;
}

/* Stat chips */
.chips{ display:flex; gap:10px; flex-wrap:wrap; }
.chip{
  padding:10px 14px; border-radius:14px;
  background:rgba(255,255,255,.6); border:1px solid #fff;
  font-size:12px; color:var(--color-secondary);
}
.chip b{ color:var(--color-primary); font-weight:600; margin-left:6px; }

/* ====== Stats grid ====== */
.stats-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; }
@media (max-width: 900px){ .stats-grid{ grid-template-columns: repeat(2,1fr); } }
.stat-card{
  padding:18px; border-radius:18px;
  background: var(--color-card); border:1px solid #fff;
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-card);
  display:flex;flex-direction:column;gap:6px;
  position:relative; overflow:hidden;
}
.stat-card .label{ font-size:12px;color:var(--color-secondary);letter-spacing:.4px; }
.stat-card .value{ font-size:26px;font-weight:700;color:var(--color-primary); }
.stat-card .sub{ font-size:11px;color:var(--color-secondary); }
.stat-card .ico-wrap{
  position:absolute; right:12px; top:12px;
  width:36px;height:36px;border-radius:12px;
  display:grid;place-items:center;color:#fff;
  background: linear-gradient(135deg,var(--color-brand),var(--color-brand-2));
  box-shadow: 0 6px 16px rgba(31,201,231,.25), inset 0 1px 0 rgba(255,255,255,.5);
}
.stat-card.v6  .ico-wrap{ background: linear-gradient(135deg,#35bfab,#1fc9e7); }
.stat-card.fdl .ico-wrap{ background: linear-gradient(135deg,#9c6bff,#1fc9e7); }
.stat-card.frp .ico-wrap{ background: linear-gradient(135deg,#ffa86b,#ef5b6e); }
.stat-card.qc  .ico-wrap{ background: linear-gradient(135deg,#22a06b,#9bd96a); }

/* Card grid (卡密列表) */
.cards-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap:14px; }
.card-item{
  padding:16px; border-radius:18px;
  background: var(--color-card); border:1px solid #fff;
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-card);
  cursor:pointer; transition: transform .25s ease, box-shadow .25s ease;
  display:flex;flex-direction:column;gap:8px;
}
.card-item:hover{ transform: translateY(-3px); box-shadow: 0 14px 30px rgba(31,41,55,.12); }
.card-item .code{ font-family: ui-monospace,Menlo,Consolas,monospace; font-size:13px; color:var(--color-primary); word-break:break-all; }
.card-item .meta{ display:flex;align-items:center;justify-content:space-between; gap:8px;font-size:11px;color:var(--color-secondary); }

/* Status badge */
.badge{
  display:inline-flex;align-items:center;gap:5px;
  padding:3px 9px;border-radius:999px;
  font-size:11px;font-weight:600;
  border:1px solid transparent;
}
.badge.unused{ background:rgba(53,191,171,.15); color:#0e8a78; border-color:rgba(53,191,171,.35); }
.badge.used{ background:rgba(123,136,142,.15); color:#5a6a72; border-color:rgba(123,136,142,.35); }
.badge.dot::before{ content:""; width:6px;height:6px;border-radius:50%;background:currentColor; }

/* Type badge */
.tbadge{
  display:inline-flex;align-items:center;
  padding:2px 8px;border-radius:8px;font-size:11px;font-weight:700;letter-spacing:.4px;color:#fff;
}
.tbadge.V6 { background: linear-gradient(135deg,#35bfab,#1fc9e7); }
.tbadge.FDL{ background: linear-gradient(135deg,#9c6bff,#1fc9e7); }
.tbadge.FRP{ background: linear-gradient(135deg,#ffa86b,#ef5b6e); }
.tbadge.QC { background: linear-gradient(135deg,#22a06b,#9bd96a); }

/* Toolbar (filters) */
.toolbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.toolbar .filter{
  padding:8px 12px;border-radius:12px;cursor:pointer;
  background:rgba(255,255,255,.5); border:1px solid #fff; color:var(--color-secondary);
  font-size:12px;
}
.toolbar .filter.active{ background:#fff; color:var(--color-primary); box-shadow:0 4px 12px rgba(31,41,55,.06); }
.toolbar .grow{ flex:1; }

/* Empty state */
.empty-state{
  padding:40px 20px; text-align:center; color:var(--color-secondary); font-size:13px;
  border:1px dashed rgba(31,41,55,.15); border-radius:18px;
  background:rgba(255,255,255,.35);
}

/* Ledger list */
.ledger-list{ display:flex;flex-direction:column;gap:8px; }
.ledger-row{
  display:grid; grid-template-columns: 36px 1fr auto auto; gap:12px;
  align-items:center;
  padding:12px 14px; border-radius:14px;
  background:rgba(255,255,255,.55); border:1px solid #fff;
  transition: background .2s;
}
.ledger-row:hover{ background:rgba(255,255,255,.75); }
.ledger-icon{
  width:36px;height:36px;border-radius:12px;display:grid;place-items:center;color:#fff;
}
.ledger-row.charge .ledger-icon{ background:linear-gradient(135deg,#ef5b6e,#ffa86b); }
.ledger-row.refund .ledger-icon{ background:linear-gradient(135deg,#22a06b,#7affc6); color:#0e3a26; }
.ledger-reason{ font-size:13px;color:var(--color-primary);font-weight:500; }
.ledger-time{ font-size:11px;color:var(--color-secondary);margin-top:2px; }
.ledger-amount{ font-size:15px;font-weight:700; }
.ledger-row.charge .ledger-amount{ color:#c63a4d; }
.ledger-row.refund .ledger-amount{ color:#0e8a78; }
.ledger-after{ font-size:11px;color:var(--color-secondary);text-align:right; }

/* Modal */
.modal-mask{
  position:fixed; inset:0; background:rgba(31,41,55,.35); backdrop-filter: blur(6px);
  display:none; align-items:center; justify-content:center; z-index:200; padding:20px;
}
.modal-mask.show{ display:flex; animation: fade-up .2s ease both; }
.modal{
  width:100%; max-width:520px; max-height:90vh; overflow:auto;
  padding:24px; border-radius:22px;
  background: rgba(255,255,255,.92);
  border:1px solid #fff;
  box-shadow: 0 30px 60px rgba(31,41,55,.25);
  animation: pop-in .35s cubic-bezier(.2,.8,.2,1) both;
}
.modal h3{ margin:0 0 14px; font-size:18px; color:var(--color-primary); display:flex;align-items:center;gap:10px; }
.modal .kv{ display:grid; grid-template-columns: 90px 1fr; gap:8px 12px; font-size:13px; }
.modal .kv .k{ color:var(--color-secondary); }
.modal .kv .v{ color:var(--color-primary); word-break:break-all; font-family: ui-monospace,Menlo,Consolas,monospace; }
.modal .actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:18px; flex-wrap:wrap; }

/* Tabs (legacy) */
.tabs{ display:flex; gap:8px; padding:6px; border-radius:16px; background:rgba(255,255,255,.55); border:1px solid #fff; width:fit-content; }
.tab{ padding:8px 14px;border-radius:12px;cursor:pointer;color:var(--color-secondary);font-size:13px; transition:all .2s; }
.tab.active{ background:#fff; color:var(--color-primary); box-shadow: 0 2px 8px rgba(31,41,55,.06); }
