/* ================= Trump Gemini · 黑金奢华主题 ================= */
:root {
  --gold-1: #FFE082;
  --gold-2: #D4AF37;
  --gold-3: #AA771C;
  --gold-4: #FFF5C0;
  --liquid-gold: linear-gradient(100deg, #AA771C 0%, #D4AF37 28%, #FFE082 50%, #FFF5C0 62%, #D4AF37 80%, #AA771C 100%);
  --red-gold: linear-gradient(135deg, #FFE082 0%, #E63946 42%, #B11226 100%);
  --navy-1: #1A2B56;
  --navy-2: #0D1838;
  --text: #E9ECF5;
  --text-2: #9AA3BD;
  --muted2: #6A7390;
  --border: rgba(212,175,55,.22);
  --ai-card: rgba(20,25,45,.85);
  --danger: #E63946;
  --shadow-gold: 0 8px 28px rgba(212,175,55,.22);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 50% -220px, rgba(255,224,130,.16), transparent 62%),
    radial-gradient(900px 700px at 108% -8%, rgba(90,60,10,.18), transparent 55%),
    radial-gradient(1200px 900px at 50% 118%, rgba(2,4,13,.9), transparent 60%),
    linear-gradient(160deg, #101E45 0%, #0A1330 38%, #050A1C 68%, #02040D 100%);
  display: flex; flex-direction: column;
  user-select: none;
}
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,.28); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,.5); }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 顶栏 ================= */
header {
  -webkit-app-region: drag;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 86px;
  flex-shrink: 0; z-index: 20;
  border-bottom: 1px solid rgba(212,175,55,.14);
  background: linear-gradient(180deg, rgba(10,19,48,.75), rgba(5,10,28,.35));
}
header button { -webkit-app-region: no-drag; }
.hspacer { flex: 1; }

.tlogo {
  width: 40px; height: 40px; border: none; cursor: pointer; flex-shrink: 0;
  background: transparent; padding: 0;
}
.tlogo-box {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(150deg, #131c3e, #060b20);
  border: 1.5px solid var(--gold-2);
  box-shadow: 0 4px 14px rgba(212,175,55,.35), inset 0 1px 0 rgba(255,245,192,.28);
  font-weight: 900; font-size: 21px; font-style: italic;
  color: var(--gold-1);
  text-shadow: 0 1px 0 #5a3e0a, 0 0 10px rgba(255,224,130,.45);
}
.tlogo-box.xl { width: 74px; height: 74px; border-radius: 20px; font-size: 40px; }
.tstar {
  position: absolute; top: -7px; right: -6px; font-size: 15px; font-style: normal;
  color: var(--gold-4); text-shadow: 0 0 8px rgba(255,224,130,.9);
}
.tlogo-box.xl .tstar { font-size: 24px; top: -10px; right: -9px; }

.modelwrap { position: relative; flex-shrink: 0; }
#modelBtn {
  display: flex; align-items: center; gap: 7px;
  border: 1.5px solid transparent; border-radius: 999px;
  background: linear-gradient(#0c1531,#0c1531) padding-box, var(--liquid-gold) border-box;
  padding: 7px 15px; font-size: 12.5px; font-weight: 800; letter-spacing: .4px;
  color: var(--gold-1); cursor: pointer; max-width: 280px;
  transition: box-shadow .25s, transform .15s;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
#modelBtn:hover { box-shadow: var(--shadow-gold); }
#modelBtn:active { transform: scale(.96); }
.mcrown { background: var(--liquid-gold); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 13px; }
#modelLabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--gold-2); transition: transform .25s; flex-shrink: 0; }
.modelwrap.open .chev { transform: rotate(180deg); }
#modelPanel {
  position: absolute; left: 0; top: calc(100% + 10px); width: 270px; max-height: 64vh;
  overflow-y: auto; z-index: 50; display: none;
  background: linear-gradient(170deg, #0d1636, #070d24);
  border: 1px solid var(--border); border-radius: 16px; padding: 6px;
  box-shadow: 0 22px 60px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,224,130,.12);
}
#modelPanel.show { display: block; }
.mpg { font-size: 10.5px; color: var(--gold-2); font-weight: 800; letter-spacing: 1px; padding: 10px 10px 5px; }
.mpo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  border: none; background: transparent; padding: 8px 10px; border-radius: 10px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; text-align: left;
}
.mpo:hover { background: rgba(212,175,55,.1); color: var(--gold-1); }
.mpo.cur { color: var(--gold-1); font-weight: 800; }
.mpo .ck { visibility: hidden; color: var(--gold-2); }
.mpo.cur .ck { visibility: visible; }

.tbtn {
  -webkit-app-region: no-drag;
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(212,175,55,.25); background: rgba(13,24,56,.55);
  color: var(--gold-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background .2s, color .2s, box-shadow .2s;
}
.tbtn:hover {
  background: linear-gradient(135deg, rgba(255,224,130,.25), rgba(170,119,28,.25));
  color: var(--gold-4); border-color: var(--gold-2);
  transform: translateY(-1px) scale(1.06); box-shadow: var(--shadow-gold);
}
.tbtn:active { transform: scale(.9); }
.tbtn.active { background: linear-gradient(135deg, rgba(255,224,130,.3), rgba(170,119,28,.2)); color: var(--gold-4); border-color: var(--gold-2); }

/* ================= 视图 ================= */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ================= 聊天消息区 ================= */
#chat {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 26px 20px; display: flex; flex-direction: column; gap: 20px;
}
.msg { display: flex; animation: msgIn .4s cubic-bezier(.22,1,.36,1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: min(76%, 760px); }
.msg.ai { align-self: flex-start; width: 100%; }
.avatar { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 2px; font-size: 18px; }
.msg.user .avatar {
  border-radius: 50%; margin-left: 10px;
  background: linear-gradient(150deg, #1a2b56, #0d1838);
  border: 1px solid rgba(120,150,230,.4); color: #9db2e8;
}
.msg.ai .avatar {
  width: 40px; height: 40px; border-radius: 12px; margin-right: 12px;
  background: linear-gradient(150deg,#131c3e,#060b20);
  border: 1.5px solid var(--gold-2);
  box-shadow: 0 4px 14px rgba(212,175,55,.4), inset 0 1px 0 rgba(255,245,192,.3);
  color: var(--gold-1); font-weight: 900; font-style: italic; font-size: 20px; position: relative;
}
.msg.ai .avatar .tstar { font-size: 12px; top: -6px; right: -6px; }
.col { min-width: 0; }
.msg.ai .col { flex: 1; max-width: calc(100% - 54px); }
.msg.user .col { display: flex; flex-direction: column; align-items: flex-end; max-width: calc(100% - 50px); }

.bubble {
  padding: 12px 17px; border-radius: 17px; font-size: 15px; line-height: 1.78;
  word-break: break-word;
}
.msg.user .bubble {
  background: linear-gradient(140deg, var(--navy-1), var(--navy-2));
  border: 1px solid rgba(120,150,230,.28);
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 20px rgba(4,10,30,.5);
}
.msg.ai .bubble {
  position: relative;
  background: var(--ai-card);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--ai-card), var(--ai-card)) padding-box, var(--liquid-gold) border-box;
  border: 1.5px solid transparent;
  border-top-left-radius: 5px;
  box-shadow: 0 10px 34px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  padding: 14px 18px 16px;
}
.pres-label {
  font-size: 10.5px; font-weight: 900; letter-spacing: 2.5px;
  background: var(--liquid-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 8px;
}
.pres-rule { height: 1px; margin: 0 0 10px; background: linear-gradient(90deg, rgba(212,175,55,.55), rgba(212,175,55,.05) 70%, transparent); }

.actions { display: flex; gap: 3px; margin-top: 6px; opacity: 0; transform: translateY(-3px); transition: opacity .25s, transform .25s; }
.msg:hover .actions, .actions.show { opacity: 1; transform: none; }
.act {
  width: 31px; height: 31px; border: none; background: transparent; border-radius: 50%;
  color: var(--muted2); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .18s;
}
.act:hover { background: rgba(212,175,55,.13); color: var(--gold-1); transform: scale(1.1); }
.act.danger:hover { background: rgba(230,57,70,.15); color: var(--danger); }
.act.copied { color: #4CC38A; }

.modelnote {
  display: inline-block; margin-top: 9px; font-size: 11px; line-height: 1.6;
  color: var(--gold-1); background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.35); border-radius: 999px; padding: 4px 13px;
}

/* ---- 烫金关键词 ---- */
.gilded {
  font-weight: 800;
  background: var(--liquid-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 12px rgba(255,224,130,.25);
}

/* ---- Markdown ---- */
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 9px 0; }
.md h1,.md h2,.md h3,.md h4 { margin: 16px 0 8px; line-height: 1.4; color: var(--gold-1); }
.md h1 { font-size: 1.38em; } .md h2 { font-size: 1.24em; } .md h3 { font-size: 1.12em; } .md h4 { font-size: 1.04em; }
.md ul,.md ol { margin: 8px 0; padding-left: 24px; }
.md li { margin: 4px 0; }
.md a { color: var(--gold-1); text-decoration: none; border-bottom: 1px solid rgba(212,175,55,.4); }
.md strong { color: var(--gold-4); font-weight: 800; }
.md blockquote { margin: 10px 0; padding: 6px 14px; color: var(--text-2); border-left: 3px solid var(--gold-2); background: rgba(212,175,55,.06); border-radius: 0 10px 10px 0; }
.md hr { border: none; border-top: 1px solid rgba(212,175,55,.25); margin: 15px 0; }
.md :not(pre) > code { background: rgba(212,175,55,.12); color: var(--gold-1); padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; }
.md pre { position: relative; background: #05080f; border: 1px solid rgba(212,175,55,.18); border-radius: 12px; padding: 36px 14px 12px; margin: 12px 0; overflow-x: auto; }
.md pre .lang { position: absolute; top: 8px; left: 14px; font-size: 10.5px; color: var(--gold-2); text-transform: uppercase; letter-spacing: 1px; }
.md pre .cp { position: absolute; top: 6px; right: 6px; width: 27px; height: 27px; border: none; border-radius: 8px; background: rgba(212,175,55,.12); color: var(--gold-1); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.md pre .cp:hover { background: rgba(212,175,55,.25); }
.md pre code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.6; color: #d6e2ff; white-space: pre; }
.md table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13.5px; display: block; overflow-x: auto; border-radius: 10px; }
.md th,.md td { border: 1px solid rgba(212,175,55,.22); padding: 7px 12px; text-align: left; }
.md th { background: rgba(212,175,55,.12); color: var(--gold-1); white-space: nowrap; }
.md tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.md img.inline { max-width: 100%; border-radius: 12px; margin: 8px 0; }
.mediabox img { max-width: 100%; border-radius: 13px; display: block; margin: 8px 0; box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.mediabox audio { width: 100%; margin: 10px 0; }
.mediabox video { max-width: 100%; border-radius: 13px; margin: 10px 0; }
.filechip { display: inline-flex; align-items: center; gap: 7px; margin: 6px 6px 0 0; border: 1px solid rgba(212,175,55,.25); border-radius: 11px; padding: 6px 12px; font-size: 12.5px; background: rgba(13,24,56,.7); color: var(--text-2); }
.dlbtn {
  display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 2px;
  border: 1px solid var(--gold-2); color: var(--gold-1); background: transparent;
  border-radius: 999px; padding: 5px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: all .2s;
}
.dlbtn:hover { background: rgba(212,175,55,.15); }

/* 金币翻转光标 */
.coin-cursor {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  margin-left: 3px; vertical-align: -1px;
  background: radial-gradient(circle at 35% 30%, #FFF5C0, #D4AF37 55%, #AA771C);
  box-shadow: 0 0 8px rgba(255,224,130,.7);
  animation: coinFlip .8s linear infinite;
}
@keyframes coinFlip {
  0% { transform: rotateY(0deg) scaleX(1); }
  50% { transform: rotateY(180deg) scaleX(.25); }
  100% { transform: rotateY(360deg) scaleX(1); }
}
.dots { display: inline-flex; gap: 6px; padding: 6px 2px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-2); animation: dot 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { background: var(--gold-1); animation-delay: .15s; }
.dots i:nth-child(3) { background: var(--gold-3); animation-delay: .3s; }
@keyframes dot { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }

/* 欢迎屏 */
.welcome { margin: auto; text-align: center; padding: 24px; animation: msgIn .6s both; user-select: none; }
.wbig { margin: 0 auto 20px; width: 74px; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.welcome h1 {
  font-size: 33px; font-weight: 900; letter-spacing: .5px; margin-bottom: 12px;
  background: var(--liquid-gold); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 4s linear infinite;
  text-shadow: 0 2px 30px rgba(212,175,55,.15);
}
@keyframes shine { to { background-position: -200% 0; } }
.welcome p { color: var(--text-2); line-height: 2.1; font-size: 14px; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.qchip {
  border: 1px solid rgba(212,175,55,.35); background: rgba(13,24,56,.55);
  color: var(--gold-1); border-radius: 999px; padding: 9px 18px; font-size: 13px; cursor: pointer;
  transition: all .22s cubic-bezier(.34,1.56,.64,1);
}
.qchip:hover { transform: translateY(-3px); box-shadow: var(--shadow-gold); border-color: var(--gold-1); }
.qchip:active { transform: scale(.94); }

/* ================= 底部输入 ================= */
footer { padding: 10px 22px 14px; flex-shrink: 0; }
.composer {
  position: relative;
  background: rgba(13,21,49,.82);
  border: 1.5px solid rgba(212,175,55,.3); border-radius: 26px;
  padding: 6px 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.composer::before {
  content: ''; position: absolute; inset: -1.5px; border-radius: 27px; pointer-events: none;
  background: var(--liquid-gold); opacity: 0; z-index: -1; filter: blur(6px);
  transition: opacity .4s;
}
.composer:focus-within { border-color: rgba(255,224,130,.75); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe {
  0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,0), 0 6px 24px rgba(0,0,0,.4); }
  50% { box-shadow: 0 0 22px rgba(212,175,55,.28), 0 6px 24px rgba(0,0,0,.4); }
}
#attachBar { display: none; flex-wrap: wrap; gap: 8px; padding: 6px 6px 2px; }
#attachBar.show { display: flex; }
.attach-item {
  position: relative; display: flex; align-items: center; gap: 7px;
  border: 1px solid rgba(212,175,55,.25); border-radius: 11px; padding: 5px 26px 5px 7px;
  font-size: 12px; background: rgba(13,24,56,.8); color: var(--text-2); max-width: 240px;
}
.attach-item img { max-height: 38px; border-radius: 7px; }
.attach-item .rm {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%;
  width: 18px; height: 18px; font-size: 11px; line-height: 18px; cursor: pointer; padding: 0;
}
.input-row { display: flex; gap: 5px; align-items: flex-end; }
.ibtn {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
  background: transparent; color: var(--gold-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.ibtn:hover { background: rgba(212,175,55,.13); color: var(--gold-1); transform: scale(1.08); }
textarea {
  flex: 1; resize: none; border: none; padding: 10px 6px; font-size: 15px; font-family: inherit;
  max-height: 130px; line-height: 1.5; background: transparent; outline: none; color: var(--text);
  user-select: text;
}
textarea::placeholder, input::placeholder { color: #5c6684; }
#sendBtn {
  width: 84px; height: 40px; border: none; border-radius: 999px; flex-shrink: 0; cursor: pointer;
  background: var(--red-gold); color: #fff8e1;
  font-weight: 900; font-size: 15px; font-style: italic; letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(80,0,10,.6);
  border: 1px solid rgba(255,224,130,.6);
  box-shadow: 0 5px 14px rgba(177,18,38,.4), inset 0 1px 0 rgba(255,245,192,.5);
  transition: transform .12s, box-shadow .2s, opacity .2s;
}
#sendBtn:hover { box-shadow: 0 8px 22px rgba(230,57,70,.5), 0 0 18px rgba(255,224,130,.35), inset 0 1px 0 rgba(255,245,192,.6); }
#sendBtn:active { transform: translateY(3px) scale(.97); box-shadow: 0 1px 4px rgba(80,0,10,.5), inset 0 2px 6px rgba(80,0,10,.4); }
#sendBtn:disabled { opacity: .55; }
#sendBtn.stop { background: linear-gradient(135deg,#b11226,#5e0a16); }
.hint { text-align: center; font-size: 10.5px; color: #56607f; margin-top: 8px; user-select: none; }
.hint a { color: var(--gold-2); text-decoration: none; cursor: pointer; }

/* ================= 抽屉 ================= */
#drawerMask {
  position: fixed; inset: 0; z-index: 60; background: rgba(2,4,13,.55);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s;
}
#drawerMask.show { opacity: 1; pointer-events: auto; }
#drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); z-index: 61;
  background: linear-gradient(175deg, #0c1531, #050a1c 70%);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0,0,0,.6);
  transform: translateX(105%); transition: transform .38s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; padding-top: 44px;
}
#drawer.show { transform: none; }
.vip-box {
  margin: 12px 14px 6px; padding: 13px 15px; border-radius: 15px;
  border: 1px solid transparent;
  background: linear-gradient(rgba(20,16,4,.9), rgba(20,16,4,.9)) padding-box, var(--liquid-gold) border-box;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.vip-title {
  font-weight: 900; font-size: 13px; letter-spacing: 1px;
  background: var(--liquid-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.vip-sub { font-size: 11px; color: var(--gold-1); }
.vip-btn {
  border: 1px solid var(--gold-2); background: transparent; color: var(--gold-1);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.vip-btn:hover { background: rgba(212,175,55,.15); }
.dhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; font-weight: 800; font-size: 15px; color: var(--text); }
.dx { width: 30px; height: 30px; border: none; border-radius: 50%; background: rgba(212,175,55,.1); color: var(--text-2); cursor: pointer; }
.dx:hover { background: rgba(230,57,70,.15); color: var(--danger); }
#convoList { flex: 1; overflow-y: auto; padding: 2px 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.convo {
  position: relative; border: 1px solid rgba(212,175,55,.15); border-radius: 13px;
  padding: 10px 40px 10px 14px; cursor: pointer; background: rgba(13,21,49,.55);
  transition: all .2s;
}
.convo:hover { border-color: var(--gold-2); transform: translateX(-3px); }
.convo.active {
  border-color: transparent;
  background: linear-gradient(rgba(26,24,8,.85), rgba(26,24,8,.85)) padding-box, var(--liquid-gold) border-box;
}
.convo .t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo .s { font-size: 11px; color: var(--muted2); margin-top: 3px; }
.convo .del {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; border-radius: 50%; background: transparent;
  color: var(--muted2); cursor: pointer;
}
.convo .del:hover { background: rgba(230,57,70,.14); color: var(--danger); }
.dempty { text-align: center; color: var(--muted2); font-size: 12.5px; padding: 36px 0; }
#drawerNew {
  margin: 10px 14px 16px; border: 1px solid rgba(255,224,130,.55); border-radius: 14px; padding: 13px;
  font-size: 13.5px; font-weight: 800; cursor: pointer;
  background: linear-gradient(135deg, rgba(255,224,130,.18), rgba(170,119,28,.12));
  color: var(--gold-1);
}
#drawerNew:hover { box-shadow: var(--shadow-gold); }

/* ================= 弹窗通用 ================= */
.modal-mask {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(2,4,13,.66); backdrop-filter: blur(4px); padding: 24px;
}
.modal {
  width: 100%; max-width: 400px;
  background: linear-gradient(170deg, #0e1738, #070d24);
  border: 1px solid var(--border); border-radius: 20px; padding: 24px;
  box-shadow: 0 28px 80px rgba(0,0,0,.7);
  animation: popIn .32s cubic-bezier(.22,1,.36,1) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 8px; color: var(--gold-1); }
.modal .muted { font-size: 12.5px; color: var(--text-2); line-height: 1.8; margin-bottom: 14px; }
.modal input, .modal select, .modal textarea {
  width: 100%; background: rgba(5,10,28,.8); border: 1.5px solid rgba(212,175,55,.25);
  border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 14px;
  outline: none; font-family: inherit; margin-bottom: 12px; user-select: text;
}
.modal input:focus, .modal select:focus { border-color: var(--gold-1); }
.modal select { padding: 8px; color-scheme: dark; }
.modal-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.btn-ghost {
  border: 1px solid rgba(154,163,189,.3); background: transparent; color: var(--text-2);
  border-radius: 12px; padding: 10px 18px; font-size: 13.5px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); }
.btn-gold {
  border: 1px solid rgba(255,224,130,.6); border-radius: 12px; padding: 10px 20px; font-size: 13.5px; font-weight: 800;
  background: var(--liquid-gold); color: #2a1c02; cursor: pointer;
  box-shadow: 0 4px 14px rgba(212,175,55,.35);
}
.btn-gold:active { transform: translateY(2px); }
.modal-err { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 8px; }
.gold-modal { border: 1px solid transparent; background: linear-gradient(#0e1738,#070d24) padding-box, var(--liquid-gold) border-box; }

/* ================= 闹钟视图 ================= */
.subhead {
  display: flex; align-items: center; gap: 11px; padding: 14px 20px 12px 92px; flex-shrink: 0;
}
.backbtn {
  position: absolute; left: 40px;
  border: none; background: transparent; color: var(--gold-2); cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.backbtn:hover { background: rgba(212,175,55,.12); color: var(--gold-1); }
.subicon { color: var(--gold-2); display: flex; }
.subicon.bolt { color: var(--gold-1); filter: drop-shadow(0 0 8px rgba(255,224,130,.5)); }
.subhead h2 { font-size: 21px; font-weight: 900; letter-spacing: 1px; color: var(--text); }
.goldplus {
  border: none; background: transparent; color: var(--gold-2); cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all .22s;
}
.goldplus:hover { color: var(--gold-4); filter: drop-shadow(0 0 8px rgba(255,224,130,.6)); transform: rotate(90deg) scale(1.08); }

.atabs { display: flex; height: 44px; flex-shrink: 0; border-bottom: 1px solid rgba(212,175,55,.12); border-top: 1px solid rgba(212,175,55,.08); }
.atab {
  flex: 1; border: none; background: rgba(212,175,55,.05); color: var(--text-2);
  font-size: 15px; font-weight: 800; cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 0;
}
.atab.active { color: var(--gold-1); }
.atab.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 38px; height: 3px; border-radius: 2px; background: var(--liquid-gold);
  box-shadow: 0 0 10px rgba(255,224,130,.7);
}
.aibody { flex: 1; overflow-y: auto; padding: 16px 22px 30px; }

.ai-cmd {
  display: flex; gap: 10px; align-items: flex-end;
  border: 1.5px solid rgba(212,175,55,.3); border-radius: 18px;
  background: rgba(13,21,49,.7); padding: 8px 8px 8px 14px; margin-bottom: 8px;
}
.ai-cmd:focus-within { border-color: rgba(255,224,130,.7); }
.ai-cmd textarea { max-height: 90px; }
.aisend {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex-shrink: 0; cursor: pointer;
  background: var(--liquid-gold); color: #2a1c02;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(212,175,55,.4);
}
.aisend:active { transform: scale(.9); }
.ai-events { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.ai-event {
  border: 1px solid rgba(212,175,55,.3); background: rgba(212,175,55,.08);
  border-radius: 12px; padding: 9px 14px; font-size: 13px; color: var(--gold-1);
  display: flex; gap: 9px; align-items: flex-start; line-height: 1.6;
}
.ai-event .evico { flex-shrink: 0; color: var(--gold-2); margin-top: 1px; }
.ai-event.tool { color: var(--text); background: rgba(13,21,49,.6); border-color: rgba(120,150,230,.2); }
.ai-event.err { border-color: rgba(230,57,70,.45); background: rgba(230,57,70,.08); color: #f18a93; }

.card-list { display: flex; flex-direction: column; gap: 13px; }
.acard {
  border: 1.5px solid rgba(212,175,55,.28); border-radius: 18px;
  background: linear-gradient(160deg, rgba(16,26,60,.9), rgba(8,14,36,.92));
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: border-color .2s, opacity .25s;
}
.acard.off { opacity: .45; }
.acard:hover { border-color: rgba(255,224,130,.55); }
.acard-main { flex: 1; min-width: 0; }
.acard-row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.atime { font-size: 33px; font-weight: 900; letter-spacing: 1px; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.badge {
  font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 11px;
  border: 1px solid var(--gold-2); color: var(--gold-1); background: rgba(212,175,55,.1);
}
.badge.mock { border-color: rgba(230,57,70,.7); color: #f18a93; background: rgba(230,57,70,.08); }
.alabel { font-size: 15.5px; font-weight: 700; margin-top: 4px; }
.arepeat { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.acard-ops { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.minibtn { border: none; background: transparent; color: var(--text-2); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.minibtn:hover { background: rgba(212,175,55,.13); color: var(--gold-1); }
.minibtn.del:hover { background: rgba(230,57,70,.13); color: var(--danger); }
.switch { width: 52px; height: 30px; border-radius: 999px; background: rgba(120,130,160,.25); border: 1px solid rgba(255,255,255,.08); position: relative; cursor: pointer; transition: background .22s; flex-shrink: 0; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(150deg,#cfd6e8,#8d96b3); transition: all .22s cubic-bezier(.34,1.56,.64,1);
}
.switch.on { background: linear-gradient(100deg, #AA771C, #FFE082); box-shadow: 0 0 12px rgba(255,224,130,.45); }
.switch.on::after { left: 24px; background: linear-gradient(150deg,#FFF5C0,#FFE082); box-shadow: 0 2px 6px rgba(0,0,0,.4); }

.course-list { display: flex; flex-direction: column; gap: 18px; }
.cday-title { font-size: 15px; font-weight: 900; color: var(--gold-1); margin: 4px 2px 2px; }
.ccard {
  border: 1.5px solid rgba(212,175,55,.22); border-radius: 16px;
  background: linear-gradient(160deg, rgba(16,26,60,.85), rgba(8,14,36,.9));
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px;
}
.ccard .ctime { font-size: 17px; font-weight: 900; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.ccard .cmain { flex: 1; min-width: 0; }
.ccard .cname { font-size: 15px; font-weight: 700; }
.ccard .cloc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }

/* 弹层细节 */
.sheet { max-width: 430px; }
.field-label { font-size: 12.5px; color: var(--text-2); margin: 4px 0 8px; font-weight: 700; }
.timepick {
  display: flex; align-items: baseline; gap: 16px; width: 100%;
  background: rgba(5,10,28,.7); border: 1.5px solid rgba(212,175,55,.35); border-radius: 14px;
  padding: 12px 18px; cursor: pointer; margin-bottom: 14px;
}
.timepick span { font-size: 30px; font-weight: 900; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.timepick em { font-style: normal; font-size: 12px; color: var(--text-2); }
.seg { display: flex; border: 1.5px solid rgba(212,175,55,.3); border-radius: 13px; overflow: hidden; margin-bottom: 14px; }
.seg button {
  flex: 1; border: none; background: rgba(5,10,28,.5); color: var(--text-2);
  padding: 11px 4px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.seg button + button { border-left: 1px solid rgba(212,175,55,.22); }
.seg button.active { background: var(--liquid-gold); color: #2a1c02; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wchip {
  min-width: 42px; height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid rgba(212,175,55,.28); background: rgba(5,10,28,.55);
  color: var(--text-2); font-size: 13px; font-weight: 700; cursor: pointer;
}
.wchip:hover { border-color: var(--gold-2); color: var(--gold-1); }
.wchip.on {
  border-color: transparent; background: var(--liquid-gold); color: #2a1c02;
  box-shadow: 0 3px 10px rgba(212,175,55,.4);
}
.time-modal select { font-size: 18px; text-align: center; font-weight: 800; color: var(--gold-1); }
.time-cols { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 14px; }
.time-cols select { width: 90px; margin: 0; }
.time-cols b { color: var(--gold-2); font-size: 22px; }
.time-range { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.time-range input { margin: 0; flex: 1; color-scheme: dark; }
.time-range span { color: var(--gold-2); }

/* ================= 神回复 ================= */
.reply-body { flex: 1; overflow-y: auto; padding: 18px 26px 30px; max-width: 820px; width: 100%; margin: 0 auto; }
.reply-card {
  border: 1.5px solid rgba(212,175,55,.3); border-radius: 20px;
  background: linear-gradient(160deg, rgba(16,26,60,.9), rgba(8,14,36,.92));
  padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.reply-title { font-size: 15px; font-weight: 900; color: var(--gold-1); margin-bottom: 12px; }
.reply-card textarea {
  background: rgba(5,10,28,.75); border: 1.5px solid rgba(212,175,55,.22); border-radius: 13px;
  padding: 12px 14px; min-height: 110px;
}
.reply-card .seg { margin-bottom: 0; margin-top: 12px; }
.win-big {
  display: block; width: 100%; margin: 16px 0;
  border: 1px solid rgba(255,224,130,.6); border-radius: 18px; padding: 17px;
  background: var(--red-gold); color: #fff8e1; font-size: 18px; font-weight: 900; font-style: italic;
  letter-spacing: 1px; cursor: pointer; text-shadow: 0 1px 2px rgba(80,0,10,.6);
  box-shadow: 0 8px 24px rgba(177,18,38,.45), inset 0 1px 0 rgba(255,245,192,.5);
  transition: transform .12s;
}
.win-big:active { transform: translateY(3px); }
.win-big:disabled { opacity: .6; cursor: default; }
.reply-list { display: flex; flex-direction: column; gap: 12px; }
.rcard {
  position: relative; border: 1.5px solid rgba(212,175,55,.3); border-radius: 16px;
  background: rgba(13,21,49,.75); padding: 15px 54px 15px 18px;
  font-size: 15px; line-height: 1.75; user-select: text;
}
.rcard .rnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 50%; margin-right: 10px;
  background: var(--liquid-gold); color: #2a1c02; font-weight: 900; font-size: 14px;
  box-shadow: 0 3px 8px rgba(212,175,55,.4); vertical-align: 2px;
}
.rcard .rcopy {
  position: absolute; right: 10px; top: 12px;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(212,175,55,.3);
  background: transparent; color: var(--gold-1); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rcard .rcopy:hover { background: rgba(212,175,55,.15); }
.rcard .rcopy.ok { border-color: #4CC38A; color: #4CC38A; }
.reply-empty { text-align: center; color: var(--muted2); margin-top: 40px; line-height: 2.2; font-size: 13.5px; }

/* ================= toast / canvas ================= */
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 18px);
  background: linear-gradient(135deg, rgba(30,24,8,.96), rgba(12,9,2,.96));
  border: 1px solid rgba(212,175,55,.5);
  color: var(--gold-1); font-size: 13px; padding: 10px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 200; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#coinCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 150; }
