/* 《又见马六甲》票务平台 共享设计系统 —— 南洋暖调 */
:root {
  --terracotta: #C45D3E;
  --terracotta-dark: #A8482D;
  --gold: #C4973E;
  --cream: #FDF8F3;
  --cream-2: #F6ECE1;
  --brown: #2C1810;
  --brown-2: #5A4636;
  --ink: #33241B;
  --muted: #8A7868;
  --line: #EADFD2;
  --green: #3E8E5A;
  --red: #C0392B;
  --blue: #3E6D9C;
  --amber: #D08A2E;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 28px rgba(44, 24, 16, .10);
  --shadow-sm: 0 2px 10px rgba(44, 24, 16, .07);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); background: var(--cream);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--terracotta); text-decoration: none; }
h1,h2,h3,h4 { color: var(--brown); margin: 0 0 .4em; line-height: 1.3; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}

/* 卡片 */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px; border: 1px solid var(--line);
}
.card + .card { margin-top: 12px; }
.card h3 { font-size: 16px; }

/* 按钮 */
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font); font-size: 15px;
  padding: 12px 18px; border-radius: 999px; background: var(--cream-2); color: var(--brown);
  font-weight: 600; transition: transform .05s, opacity .15s, background .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--terracotta), var(--terracotta-dark)); color: #fff; box-shadow: 0 6px 16px rgba(196,93,62,.32); }
.btn-gold { background: linear-gradient(135deg, #D8AE5E, var(--gold)); color: #3a2a08; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--brown-2); }
.btn-danger { background: #FBE9E7; color: var(--red); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn + .btn { margin-left: 8px; }

/* 表单 */
label.fld { display: block; margin-bottom: 12px; }
label.fld .lab { display: block; font-size: 13px; color: var(--brown-2); margin-bottom: 5px; font-weight: 600; }
input, select, textarea {
  width: 100%; font-family: var(--font); font-size: 15px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--terracotta); }
input::placeholder { color: #B9A99A; }
.switch { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }

/* 标签 / 状态 */
.tag { display:inline-flex; align-items:center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.7; }
.tag-green{background:#E4F2E9;color:var(--green)}
.tag-red{background:#FBE9E7;color:var(--red)}
.tag-gold{background:#F7ECD6;color:#9A6E1E}
.tag-blue{background:#E6EEF6;color:var(--blue)}
.tag-gray{background:#EFE9E2;color:var(--muted)}
.tag-amber{background:#FAEFDD;color:var(--amber)}

/* 价格 */
.price { color: var(--terracotta); font-weight: 700; }
.price .cur { font-size: .72em; font-weight: 600; }
.price .amt { font-size: 1.18em; }
.cny { color: var(--muted); font-size: 12px; font-weight: 500; }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(253,248,243,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.topbar .title { font-weight: 700; color: var(--brown); font-size: 17px; }
.topbar .back { font-size: 20px; color: var(--brown); cursor: pointer; line-height: 1; }

/* 底部安全区 */
.safe-bottom { height: 84px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; text-align: center; color: var(--muted); font-size: 11px; padding: 5px 0; }
.tabbar a .ic { font-size: 20px; display: block; line-height: 1.2; }
.tabbar a.on { color: var(--terracotta); font-weight: 700; }

/* 容器 */
.wrap-mobile { max-width: 520px; margin: 0 auto; padding: 14px 14px 20px; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 18px 22px 60px; }

/* 表格式列表 */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { background: var(--cream-2); color: var(--brown-2); font-weight: 700; font-size: 12.5px; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

/* 指标卡 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi .v { font-size: 24px; font-weight: 800; color: var(--brown); line-height: 1.1; }
.kpi .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .k { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kpi.accent .v { color: var(--terracotta); }
.kpi.gold .v { color: var(--gold); }

/* toast / modal */
#toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 200; background: rgba(44,24,16,.92); color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px; max-width: 86%; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
.modal-mask { position: fixed; inset: 0; background: rgba(44,24,16,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 20px; box-shadow: var(--shadow); }
.modal h3 { margin-top: 0; }

/* 空态 */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* 骨架/徽标 */
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.hr { height: 1px; background: var(--line); border: 0; margin: 14px 0; }
.pill-nav { display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; }
.pill-nav button { white-space: nowrap; }
.pill-nav button.on { background: var(--terracotta); color:#fff; }

/* 票券券面 */
.ticket {
  background: linear-gradient(135deg, #fff, #FFF7EF); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; position: relative;
}
.ticket .perf { background: linear-gradient(120deg, var(--terracotta), #D1794F); color: #fff; padding: 14px 16px; }
.ticket .perf h4 { color: #fff; margin: 0; }
.ticket .body { padding: 14px 16px; }
.ticket .dash { border-top: 1.5px dashed var(--line); margin: 4px 0; position: relative; }
.qrbox { background:#fff; border:1px solid var(--line); border-radius: 10px; padding:10px; text-align:center; }
.qrbox .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: 1px; font-size: 14px; }

/* 日历 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-cell { aspect-ratio: 1/1.05; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; position: relative; }
.cal-cell .d { font-weight: 700; color: var(--brown); }
.cal-cell .t { font-size: 9.5px; color: var(--terracotta); margin-top: 2px; }
.cal-cell.off { background: #F2ECE5; cursor: not-allowed; }
.cal-cell.off .d, .cal-cell.off .t { color: #C3B5A6; }
.cal-cell.soldout { background: #F7F0EA; cursor: not-allowed; }
.cal-cell.soldout .d { color: #B7A898; text-decoration: line-through; }
.cal-cell.on { border-color: var(--terracotta); background: #FDF0EA; box-shadow: 0 0 0 2px rgba(196,93,62,.15); }
.cal-cell.peak::after { content: '旺'; position: absolute; top: 2px; right: 4px; font-size: 8.5px; color: var(--gold); font-weight: 700; }

@media (max-width: 640px) {
  .wrap-wide { padding: 12px 12px 80px; }
  .kpi .v { font-size: 20px; }
}
