/* 云兔兔共享基础样式：设计 token + 顶部栏 + 登录弹窗。
   所有工具通过 /shared/base.css 引用，保证 UI 一致。 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #aeaeb2;
  --border: rgba(0,0,0,.06);
  --border-strong: #d2d2d7;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --accent: #0071e3;
  --danger: #ff3b30;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262629;
    --card-bg: #2c2c2e;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #6e6e73;
    --border: rgba(255,255,255,.08);
    --border-strong: #48484a;
    --shadow: 0 1px 3px rgba(0,0,0,.2);
  }
  .top-bar { background: #000; border-bottom-color: rgba(255,255,255,.08); }
}

body {
  font-family: -apple-system, "SF Pro Display", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container { max-width: 1500px; margin: 0 auto; padding: 0 24px; }

/* ---- Top Bar ---- */
.top-bar {
  background: rgba(0,0,0,.05);
  border-bottom: 1px solid var(--border);
}
.top-bar-inner {
  max-width: 1500px; margin: 0 auto; padding: 6px 24px;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.top-bar-brand {
  font-size: 0.88rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -.01em;
}
.top-bar-brand:hover { color: var(--accent); }
.top-bar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap;
}
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.top-bar .user-btn {
  font-size: 12px; padding: 5px 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text-secondary); cursor: pointer; font-weight: 600;
  transition: all .15s ease; text-decoration: none; font-family: inherit;
}
.top-bar .user-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.top-bar .user-name { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

/* ---- Auth Modal ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card-bg); border-radius: calc(16px * var(--ui-scale, 1));
  padding: calc(32px * var(--ui-scale, 1)); width: calc(380px * var(--ui-scale, 1)); max-width: 90vw;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
}
.modal h3 { font-size: calc(18px * var(--ui-scale, 1)); margin-bottom: calc(20px * var(--ui-scale, 1)); color: var(--text); }
.modal label { display: block; font-size: calc(13px * var(--ui-scale, 1)); color: var(--text-secondary); margin-bottom: calc(4px * var(--ui-scale, 1)); }
.modal input[type="text"], .modal input[type="url"], .modal input[type="password"] {
  width: 100%; padding: calc(10px * var(--ui-scale, 1)) calc(14px * var(--ui-scale, 1)); border: 1px solid var(--border);
  border-radius: calc(10px * var(--ui-scale, 1)); font-size: calc(14px * var(--ui-scale, 1)); margin-bottom: calc(14px * var(--ui-scale, 1));
  background: var(--bg); color: var(--text); outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-btns { display: flex; gap: calc(8px * var(--ui-scale, 1)); justify-content: flex-end; margin-top: calc(16px * var(--ui-scale, 1)); }
.modal .btn, .modal .btn-sm {
  padding: calc(8px * var(--ui-scale, 1)) calc(20px * var(--ui-scale, 1)); border-radius: calc(10px * var(--ui-scale, 1)); border: none; font-size: calc(14px * var(--ui-scale, 1));
  cursor: pointer; font-weight: 500;
}
.modal .btn-primary { background: var(--accent); color: #fff; }
.modal .btn-cancel { background: var(--border); color: var(--text); }
.modal .btn-danger { background: var(--danger); color: #fff; }
.login-switch { font-size: calc(13px * var(--ui-scale, 1)); color: var(--accent); cursor: pointer; text-align: center; margin-top: calc(8px * var(--ui-scale, 1)); }

/* ---- Toast（元素由 /shared/toast.js 自动插入）---- */
/* --toast-top 是留给页面的旋钮：默认 20px 够用在只有共享顶栏的页面上；
   主页还多一条行情条，会盖住，它自己把值调高即可。 */
.toast {
  position: fixed; top: var(--toast-top, calc(20px * var(--ui-scale, 1))); left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - calc(32px * var(--ui-scale, 1))); text-align: center;
  background: #333; color: #fff; padding: calc(10px * var(--ui-scale, 1)) calc(24px * var(--ui-scale, 1)); border-radius: calc(8px * var(--ui-scale, 1));
  font-size: calc(0.88rem * var(--ui-scale, 1)); font-weight: 500; z-index: 9999;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.toast.show { opacity: 1; }
.toast.error { background: #dc2626; }
.toast.success { background: #16a34a; }
@media (prefers-color-scheme: dark) {
  .toast { background: #e5e5e5; color: #1d1d1f; }
  .toast.error { background: #dc2626; color: #fff; }
  .toast.success { background: #16a34a; color: #fff; }
}

/* ---- 手势提示（元素由 /shared/gestures.js 自动插入）---- */
.ptr-hint {
  position: fixed; z-index: 99999; pointer-events: none;
  display: flex; align-items: center; gap: calc(10px * var(--ui-scale, 1));
  background: rgba(44,44,46,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #fff; font-size: calc(0.95rem * var(--ui-scale, 1)); font-weight: 700; letter-spacing: .05em;
  opacity: 0; transition: opacity .2s ease;
}
.ptr-hint.show { opacity: 1; }
/* 下拉提示：左右拉满、内容居中，这样 JS 可以独占 transform 去做位移。
   不给 transform 加过渡 —— 拖拽时位移是每帧算的，加了过渡会跟手不及。 */
.ptr-hint-pull {
  top: 0; left: 0; right: 0; justify-content: center;
  padding: calc(10px * var(--ui-scale, 1)) 0; border-radius: 0 0 calc(14px * var(--ui-scale, 1)) calc(14px * var(--ui-scale, 1));
}
/* 这里原本还有一套「右滑后退」的提示样式（.ptr-hint-back / .ptr-fill），
   2026-09-24 按用户要求把后退功能整个删了，样式一并清掉。 */
.ptr-hint.ready { background: rgba(0,113,227,.85); }
.ptr-arrow { font-size: calc(1.15rem * var(--ui-scale, 1)); transition: transform .2s ease; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .container { max-width: 100%; }
  .top-bar-inner { max-width: 100%; }
}

@media (max-width: 640px) {
  .container { max-width: 100%; padding: 0 16px; }
  .top-bar-inner { max-width: 100%; padding: 6px 16px; }
  .top-bar-center { font-size: 0.75rem; }
  .top-bar-brand { font-size: 0.82rem; }
}
