/* ===== Noticing — iOS 26 Liquid Glass ===== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --text: #f5f5f7;
  --text-dim: rgba(235, 235, 245, 0.55);
  --accent: #7c9cff;
  --accent-2: #b78bff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --radius: 22px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #000;
  -webkit-font-smoothing: antialiased;
}

/* ===== 背景 ===== */
.bg-gradient {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(160deg, #0a0a1a 0%, #1a1035 40%, #0f1a2e 100%);
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.6;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #5b7cfa, transparent 70%);
  top: -120px; left: -80px;
  animation: float1 18s ease-in-out infinite;
}
.orb-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #bf5af2, transparent 70%);
  bottom: -80px; right: -60px;
  animation: float2 22s ease-in-out infinite;
}
.orb-3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #30d0ff, transparent 70%);
  top: 40%; left: 45%;
  animation: float3 20s ease-in-out infinite;
}
@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(40px,-50px) scale(1.08)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-50px,40px) scale(1.05)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 33%{transform:translate(-30px,-40px) scale(.95)} 66%{transform:translate(40px,30px) scale(1.05)} }

/* ===== 液态玻璃 ===== */
.glass {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.1), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}

/* ===== 密码门 ===== */
.lock-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lock-card {
  border-radius: 28px; padding: 44px 36px;
  width: 100%; max-width: 340px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: lockIn .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes lockIn { from{opacity:0;transform:scale(.9) translateY(20px)} to{opacity:1;transform:scale(1) translateY(0)} }
.lock-icon { font-size: 48px; margin-bottom: 12px; filter: drop-shadow(0 4px 12px rgba(124,156,255,.4)); }
.lock-card h2 {
  font-size: 26px; font-weight: 700; margin-bottom: 24px;
  background: linear-gradient(135deg, #fff, #b8c4ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#lockForm { display: flex; flex-direction: column; gap: 14px; }
#lockInput {
  width: 100%; padding: 14px 18px; font-size: 18px; text-align: center;
  letter-spacing: 6px; color: var(--text);
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 14px; outline: none; transition: all .3s;
  font-family: "SF Mono", "Menlo", monospace;
}
#lockInput:focus {
  border-color: var(--accent); background: rgba(124,156,255,.1);
  box-shadow: 0 0 20px rgba(124,156,255,.2);
}
#lockForm button {
  padding: 14px; font-size: 16px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; border-radius: 14px; cursor: pointer; transition: all .25s;
  box-shadow: 0 4px 20px rgba(124,156,255,.35);
}
#lockForm button:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(124,156,255,.5); }
#lockForm button:active { transform: scale(.97); }
.lock-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

/* ===== 布局 ===== */
.container {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: 28px 20px 48px;
  animation: fadeUp .5s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

/* ===== 顶部 ===== */
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo span { font-size: 28px; filter: drop-shadow(0 0 14px rgba(124,156,255,.5)); }
.logo h1 {
  font-size: 24px; font-weight: 700; letter-spacing: -.5px;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.status {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; font-size: 13px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 100px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.status-dot.online { background: var(--green); box-shadow: 0 0 10px rgba(48,209,88,.5); animation: pulse 2s ease-in-out infinite; }
.status-dot.offline { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.85)} }
.btn-icon {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%; transition: all .25s;
}
.btn-icon:hover { background: rgba(255,69,58,.15); border-color: rgba(255,69,58,.3); }

/* ===== 卡片 ===== */
.card {
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

/* ===== 开关 ===== */
.toggle-card { display: flex; align-items: center; justify-content: space-between; }
.toggle-card h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.toggle-card p { font-size: 13px; color: var(--text-dim); max-width: 360px; line-height: 1.5; }
.switch { position: relative; display: inline-block; width: 62px; height: 36px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(120,120,128,.32); border-radius: 36px;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}
.slider::before {
  content: ""; position: absolute; height: 28px; width: 28px; left: 4px; bottom: 4px;
  background: #fff; border-radius: 50%;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, #5b7cfa, #bf5af2);
  box-shadow: 0 0 24px rgba(91,124,250,.5);
}
.switch input:checked + .slider::before { transform: translateX(26px); }

/* ===== API 卡片 ===== */
.api-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.api-header h2 { font-size: 15px; font-weight: 600; }
.btn-copy {
  padding: 6px 16px; font-size: 13px; color: var(--text); cursor: pointer;
  background: rgba(124,156,255,.18); border: 1px solid rgba(124,156,255,.3);
  border-radius: 10px; transition: all .25s;
}
.btn-copy:hover { background: rgba(124,156,255,.3); }
.btn-copy.copied { background: rgba(48,209,88,.2); border-color: var(--green); color: var(--green); }
.api-url {
  font-family: "SF Mono", "Cascadia Code", "Menlo", monospace; font-size: 13px;
  padding: 12px 14px; background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.06); border-radius: 12px;
  word-break: break-all; color: #a5b4fc; margin-bottom: 8px;
}
.api-hint { font-size: 12px; color: var(--text-dim); }
.api-hint code {
  padding: 2px 6px; background: rgba(124,156,255,.12); border-radius: 5px;
  font-size: 11px; color: #c4b5fd;
}

/* ===== 消息列表 ===== */
.messages-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.messages-header h2 { font-size: 15px; font-weight: 600; }
.btn-clear {
  padding: 5px 14px; font-size: 12px; color: var(--text-dim); cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; transition: all .25s;
}
.btn-clear:hover { color: var(--red); border-color: rgba(255,69,58,.4); background: rgba(255,69,58,.1); }
.messages-list { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.messages-list::-webkit-scrollbar { width: 4px; }
.messages-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-dim); }
.empty-icon { font-size: 44px; margin-bottom: 10px; opacity: .5; }
.empty-state p { font-size: 14px; }
.msg-item {
  padding: 12px 16px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06); border-radius: 14px;
  animation: slideIn .4s cubic-bezier(.34,1.56,.64,1);
}
.msg-item.new { border-color: rgba(124,156,255,.4); box-shadow: 0 0 16px rgba(124,156,255,.1); }
.msg-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.msg-title .dot-new {
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 8px rgba(124,156,255,.6); animation: pulse 1.5s ease-in-out infinite; flex-shrink: 0;
}
.msg-body { font-size: 13px; color: var(--text-dim); line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.msg-time { font-size: 11px; color: var(--text-dim); margin-top: 6px; opacity: .5; }
@keyframes slideIn { from{opacity:0;transform:translateY(-8px) scale(.97)} to{opacity:1;transform:translateY(0) scale(1)} }

/* ===== Toast 错误提示 ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
  z-index: 200; padding: 12px 22px; font-size: 14px;
  background: rgba(255, 69, 58, 0.9); color: #fff;
  border-radius: 14px; backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(255, 69, 58, 0.4);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .container { padding: 16px 14px 36px; }
  .toggle-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .switch { align-self: flex-end; }
  .logo h1 { font-size: 20px; }
}
