/* dianpu 店铺系统 · 统一设计系统（login / index / user / admin 四个页面共用）
   改版原则：一套品牌色、一套卡片与按钮、一套弹窗样式，页面之间只保留各自的结构差异。
   本文件只影响 dianpu 自己的页面，不涉及商城与下单系统。 */

:root {
  /* 品牌色（xiadan 紫），--brand 为新名，--purple 为历史名，值保持一致 */
  --brand: #6673d8;
  --brand-dark: #5361c6;
  --brand-soft: #f0f1ff;
  --purple: #6673d8;
  --purple-dark: #5361c6;
  --purple-soft: #f0f1ff;
  /* 文字与线条 */
  --ink: #2f3441;
  --muted: #6d7280;
  --line: #e0e2ea;
  --soft: #f8f9fc;
  /* 语义色 */
  --green: #27935a;
  --green-dark: #207b4c;
  --green-soft: #edf8f2;
  --amber: #a96715;
  --amber-soft: #fff7e8;
  --red: #c2454d;
  --red-soft: #fff1f2;
  --err: #c2454d;
  /* 阴影与圆角 */
  --shadow: 0 7px 20px #343a5e12;
  --shadow-lg: 0 8px 24px #343a5e14;
  --radius: 12px;
  --radius-sm: 8px;
  --page-width: 1000px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f1f2f8; color: var(--ink); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--brand-dark); }

/* ---------- 页头（紫条）与页面容器 ---------- */
.app-shell { min-height: 100vh; padding-bottom: 48px; }
.center { max-width: 360px; margin: 80px auto; text-align: center; }
.page-header { padding: 20px max(18px, calc((100vw - var(--page-width)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #fff; background: #616fd0; box-shadow: 0 7px 24px #4148892e; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.page-subtitle { margin: 6px 0 0; color: #eceeff; font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-actions .button.ghost { background: #ffffff26; color: #fff; border-color: #ffffff40; }
.header-actions .button.ghost:hover { background: #ffffff33; }
.link-button { background: #ffffff26; color: #fff; border: 1px solid #ffffff40; border-radius: var(--radius-sm); padding: 7px 12px; font-size: 13px; }
.page-content { max-width: var(--page-width); margin: 0 auto; padding: 20px 18px; }
.narrow { max-width: 420px; margin: 0 auto; padding: 48px 20px; }

/* ---------- 卡片 / 面板 ---------- */
.panel, .order-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 14px; }
.order-card { box-shadow: var(--shadow-lg); margin-bottom: 16px; }
.order-card-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.order-title { font-size: 17px; font-weight: 600; }
.order-hint { color: var(--muted); font-size: 12px; margin-top: 6px; max-width: 560px; line-height: 1.6; }
.order-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.order-section:last-of-type { border-bottom: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading-title { display: flex; align-items: center; gap: 10px; }
.section-number { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.section-heading h3 { margin: 0; font-size: 14px; }
.order-count { color: var(--muted); font-size: 12px; }

/* ---------- 用户资产条（参照 xiadan：昵称 / 积分 / 余额 / 奖金） ---------- */
.asset-strip { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 20px; margin-bottom: 16px; }
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.asset-grid > div { min-width: 0; }
.asset-grid span { display: block; color: var(--muted); font-size: 12px; }
.asset-grid strong { display: block; font-size: 16px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-strip.empty .asset-grid strong { color: var(--muted); font-weight: 500; }
.asset-meta { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; }

/* ---------- 按钮 ---------- */
.button { padding: 9px 14px; border: 0; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-size: 13px; }
.button:hover { background: var(--brand-dark); }
.button.secondary { background: var(--brand-soft); color: var(--brand-dark); }
.button.secondary:hover { background: #e5e7fb; }
.button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.button.ghost:hover { background: var(--soft); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.danger:hover { background: #ffe4e6; }
.button.warn { background: var(--amber); color: #fff; }
.button.warn:hover { background: #96600f; }
.button.primary { background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.mini { padding: 5px 10px; font-size: 12px; }
.button.block { width: 100%; padding: 11px; font-size: 14px; }
.button.submit-button { padding: 11px 26px; font-size: 14px; }

/* 裸按钮也统一为品牌按钮（历史页面上有 <button> 不带 class 的写法） */
button { padding: 9px 14px; border: 0; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-size: 13px; }
button:hover { background: var(--brand-dark); }
button:disabled:hover { background: var(--brand); }
/* 通用修饰类：可单独使用（.ghost / .mini / .warn / .danger ...），也可与 .button 叠加 */
.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.ghost:hover { background: var(--soft); }
.secondary { background: var(--brand-soft); color: var(--brand-dark); }
.secondary:hover { background: #e5e7fb; }
.primary { background: var(--green); }
.primary:hover { background: var(--green-dark); }
.warn { background: var(--amber); color: #fff; }
.warn:hover { background: #96600f; }
.danger { background: var(--red-soft); color: var(--red); }
.danger:hover { background: #ffe4e6; }
.mini { padding: 5px 10px; font-size: 12px; }
.block { width: 100%; padding: 11px; font-size: 14px; }

/* ---------- 表单 ---------- */
input, select, textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: 13px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #6673d81f; }
input:disabled, select:disabled, textarea:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
.field { display: block; margin-bottom: 10px; }
.field > span:first-child { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.form label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.input-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-message { font-size: 12px; margin: 8px 0 0; min-height: 16px; color: var(--muted); }
.field-message.ok { color: var(--green-dark); }
.field-message.err { color: var(--red); }
.field-message.checking { color: var(--amber); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; background: var(--amber-soft); border: 1px solid #f0d9a8; color: var(--amber); }
.search-tip { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #f0d9a8; color: var(--amber); font-size: 12px; line-height: 1.7; }
.search-tip b { font-weight: 600; }
.msg { font-size: 13px; min-height: 18px; margin: 8px 0; color: var(--muted); }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green-dark); }

/* ---------- 标签栏 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; }

/* ---------- 弹窗（统一：页面内所有弹窗都用这套） ---------- */
.backdrop { position: fixed; inset: 0; background: #2f344166; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 50; }
.dialog { width: 100%; max-width: 560px; background: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px #343a5e33; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-header h3 { margin: 0; font-size: 15px; }
.dialog-body { padding: 18px 20px; }
.dialog-footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-button { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); }
.icon-button:hover { color: var(--ink); }
.health-overview { display: flex; gap: 12px; align-items: center; padding: 14px 20px; background: var(--soft); border-bottom: 1px solid var(--line); }
.health-overview strong { display: block; font-size: 14px; }
.health-overview span { color: var(--muted); font-size: 12px; }
.health-list { list-style: none; margin: 0; padding: 8px 20px 0; max-height: 46vh; overflow: auto; }
.health-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.health-list li:last-child { border-bottom: 0; }
.health-check-icon { width: 18px; text-align: center; font-weight: 700; }
.health-check-icon.ok { color: var(--green); }
.health-check-icon.bad { color: var(--red); }
.health-list strong { display: block; font-size: 13px; font-weight: 600; }
.health-list span { color: var(--muted); font-size: 12px; }

/* ---------- 轻提示 ---------- */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #2f3441; color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: 0 8px 24px #343a5e33; z-index: 60; }
.toast.bad { background: var(--red); }

/* ---------- 页头状态按钮（健康检测） ---------- */
.health-button { padding: 8px 14px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; color: var(--brand-dark); }
.health-button.healthy { background: var(--green-soft); color: var(--green-dark); }
.health-button.degraded { background: var(--red-soft); color: var(--red); }
.health-button.pending { background: var(--soft); color: var(--muted); }

/* ---------- 首页：状态条与入口卡 ---------- */
.status-strip { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 20px; }
.status-strip .body { flex: 1 1 auto; min-width: 0; }
.status-strip .line1 { font-size: 15px; }
.status-strip .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex: 0 0 auto; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.nav-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.nav-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-decoration: none; color: var(--ink); }
.nav-card:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.nav-card h3 { margin: 0 0 6px; font-size: 16px; }
.nav-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.banner { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }

/* ---------- 结果块（登录页展示身份/资产） ---------- */
.result-box { margin-top: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.9; }
.result-box b { display: inline-block; width: 76px; color: var(--muted); font-weight: 500; }

@media (max-width: 720px) {
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .nav-cards { grid-template-columns: 1fr; }
  .page-header { padding: 16px; }
  .page-content { padding: 14px; }
}

/* 公共弹窗（assets/app.js 的 uiConfirm / uiPrompt 共用这一套样式） */
.dialog-host { position: relative; z-index: 50; }
.app-dialog { max-width: 460px; }
.dialog-text { margin: 0; font-size: 13px; line-height: 1.8; color: var(--ink); white-space: pre-wrap; }
.dialog-input { width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-size: 14px; }
.dialog-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dialog-actions { display: flex; align-items: center; gap: 8px; }
