/* 叙白 · DIY 奶茶 - 共享样式（奶茶主题 v2） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --green: #07c160;
  --green-dark: #06a552;
  --tea: #b5773a;
  --tea-deep: #8a5a2b;
  --tea-light: #f7efe5;
  --bg: #f5efe6;
  --card: #ffffff;
  --text: #2b2118;
  --text-2: #9c8b78;
  --line: #f0e6d8;
  --red: #e8433e;
  --gold: #f59e0b;
  --shadow-card: 0 2px 8px rgba(120, 84, 40, .06), 0 8px 24px rgba(120, 84, 40, .05);
  --shadow-float: 0 6px 20px rgba(120, 84, 40, .16);
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e9e2d5;
  color: var(--text);
  display: flex; justify-content: center;
  min-height: 100vh;
}
.phone {
  width: 100%; max-width: 480px; min-height: 100vh;
  background:
    radial-gradient(600px 300px at 85% -50px, rgba(181,119,58,.10), transparent 70%),
    radial-gradient(500px 260px at -60px 30%, rgba(7,193,96,.07), transparent 70%),
    var(--bg);
  display: flex; flex-direction: column;
  box-shadow: 0 0 30px rgba(0,0,0,.12);
  position: relative;
}

/* ================= 顶部导航 ================= */
.app-header {
  background: linear-gradient(135deg, #c08a4e 0%, #b5773a 45%, #8a5a2b 100%);
  color: #fff; padding: 22px 18px 18px;
  position: sticky; top: 0; z-index: 10;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(138, 90, 43, .28);
}
.app-header::before, .app-header::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.10); pointer-events: none;
}
.app-header::before { width: 130px; height: 130px; top: -58px; right: -34px; }
.app-header::after { width: 80px; height: 80px; bottom: -40px; left: -18px; background: rgba(255,255,255,.07); }
.app-header h1 {
  font-size: 20px; letter-spacing: 1px; font-weight: 800;
  text-shadow: 0 2px 6px rgba(90, 52, 16, .35);
  position: relative;
}
.app-header .sub { font-size: 12px; opacity: .9; margin-top: 4px; position: relative; letter-spacing: .5px; }
main { flex: 1; overflow-y: auto; padding: 14px 14px 90px; }

/* 底部 Tab */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 18px rgba(120, 84, 40, .08);
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 9px 0 11px;
  font-size: 12px; color: var(--text-2); cursor: pointer;
  position: relative; transition: color .2s;
  font-weight: 500;
}
.tabbar button span.tab-icon { display: block; font-size: 19px; line-height: 1.3; transition: transform .2s; }
.tabbar button.active { color: var(--green); font-weight: 700; }
.tabbar button.active span.tab-icon { transform: translateY(-1px) scale(1.08); }
.tabbar button.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--green), #35d884);
}

/* ================= 卡片 ================= */
.card {
  background: var(--card); border-radius: 16px; padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(240, 230, 216, .7);
  animation: cardIn .35s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.card .name { font-size: 16px; font-weight: 700; }
.card .creator { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.recipe-img {
  width: 74px; height: 74px; border-radius: 14px; object-fit: cover;
  margin-right: 12px; flex-shrink: 0; background: var(--tea-light);
  box-shadow: 0 2px 6px rgba(120, 84, 40, .12);
}
.card .items-summary {
  font-size: 12px; color: #7a6649; margin: 9px 0;
  background: var(--tea-light); border-radius: 10px; padding: 9px 11px; line-height: 1.7;
  border: 1px dashed #e6d3b6;
}
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }

/* 排行榜徽章 */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 4px;
  text-align: center; border-radius: 8px; font-size: 12px; font-weight: 800;
  color: #fff; background: #c9beb0; margin-right: 8px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.rank-1 {
  background: linear-gradient(135deg, #ffc23d, #f59e0b);
  box-shadow: 0 2px 6px rgba(245,158,11,.4);
}
.rank-2 {
  background: linear-gradient(135deg, #cfd6dd, #a3b0bd);
  box-shadow: 0 2px 6px rgba(163,176,189,.4);
}
.rank-3 {
  background: linear-gradient(135deg, #e0a67a, #c67b4d);
  box-shadow: 0 2px 6px rgba(198,123,77,.4);
}

/* ================= 按钮 ================= */
.btn {
  border: none; border-radius: 999px; padding: 9px 18px;
  font-size: 13px; cursor: pointer; transition: all .18s;
  font-weight: 600; letter-spacing: .3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.btn:active { transform: scale(.96); opacity: .9; }
.btn-primary {
  background: linear-gradient(135deg, #16d675, #07c160);
  color: #fff; box-shadow: 0 4px 12px rgba(7,193,96,.32);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(7,193,96,.3); }
.btn-outline { background: #fff; border: 1.5px solid var(--green); color: var(--green); }
.btn-outline:active { background: #effdf5; }
.btn-ghost { background: #f3ede2; color: #8a6d4b; }
.btn-ghost:active { background: #ece3d2; }
.btn-danger { background: #fff; border: 1.5px solid var(--red); color: var(--red); }
.btn-big { width: 100%; padding: 14px; font-size: 15px; border-radius: 14px; }
.like-btn {
  border: 1.5px solid #f3c9c7; background: #fff; color: var(--red);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: all .18s; font-weight: 600;
}
.like-btn:active { transform: scale(.95); }
.like-btn.liked {
  background: linear-gradient(135deg, #ff6b6b, #e8433e); color: #fff;
  border-color: transparent; box-shadow: 0 3px 10px rgba(232,67,62,.3);
}

/* ================= 表单 ================= */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 600; }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid #e5d9c6; border-radius: 12px;
  font-size: 14px; background: #fffdf9; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(7,193,96,.12);
}

/* ================= 材料滑条行 ================= */
.mat-section { margin-bottom: 6px; }
.mat-section h3 {
  font-size: 14px; margin: 16px 0 9px; color: var(--tea-deep);
  display: flex; align-items: center; gap: 6px; font-weight: 800;
}
.mat-section h3::before {
  content: ''; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, #c08a4e, #8a5a2b);
}
.mat-row {
  background: #fff; border-radius: 14px; padding: 11px 13px; margin-bottom: 9px;
  border: 1.5px solid var(--line);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.mat-row.active {
  border-color: var(--green);
  background: linear-gradient(180deg, #f2fdf7, #e9faf1);
  box-shadow: 0 3px 10px rgba(7,193,96,.10);
}
.mat-row .top { display: flex; justify-content: space-between; align-items: baseline; }
.mat-row .mname { font-size: 14px; font-weight: 600; }
.mat-row .mprice { font-size: 11px; color: var(--text-2); background: #f7f1e6; padding: 2px 8px; border-radius: 999px; }
.mat-row.active .mprice { background: rgba(7,193,96,.12); color: #058b4c; }
.mat-row .ctrl { display: flex; align-items: center; gap: 10px; margin-top: 9px; }

/* 滑条美化（Webkit 内核：Chrome / 微信内置浏览器） */
.mat-row input[type=range] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px;
  background: #e8e0d2; outline: none;
}
.mat-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #f0f0f0 40%, #07c160 42%, #06a552);
  border: none;
  box-shadow: 0 2px 6px rgba(6,165,82,.45);
  cursor: pointer;
  transition: transform .15s;
}
.mat-row input[type=range]::-webkit-slider-thumb:active { transform: scale(1.15); }
.mat-row input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 35% 30%, #fff, #f0f0f0 40%, #07c160 42%, #06a552);
  box-shadow: 0 2px 6px rgba(6,165,82,.45); cursor: pointer;
}
.mat-row .qty-box { display: flex; align-items: center; gap: 5px; background: #faf5ec; border-radius: 10px; padding: 3px 5px 3px 8px; }
.mat-row input[type=number] {
  width: 60px; padding: 5px 4px; border: none; border-radius: 8px;
  font-size: 13px; text-align: center; outline: none; background: #fff;
  box-shadow: inset 0 0 0 1px #e5d9c6;
}
.mat-row input[type=number]:focus { box-shadow: inset 0 0 0 1.5px var(--green); }
.mat-row .unit { font-size: 12px; color: var(--text-2); min-width: 18px; }

/* 照片上传 */
.photo-upload img {
  width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px;
  margin-bottom: 9px; display: block; border: 1px solid var(--line);
}
.photo-upload .btn { margin-top: 4px; }
.admin-recipe-img {
  width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px;
  margin: 9px 0; border: 1px solid var(--line); display: block;
}

/* ================= 汇总条 ================= */
.summary-bar {
  position: sticky; bottom: 0; background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 18px 18px 0 0; padding: 13px 16px 15px;
  box-shadow: 0 -6px 24px rgba(120, 84, 40, .14);
  margin-top: 12px;
  border: 1px solid var(--line); border-bottom: none;
}
.summary-bar .line { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.summary-bar .total {
  font-size: 19px; font-weight: 800; color: var(--red);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

/* ================= 搜索 ================= */
.search-box { display: flex; gap: 8px; margin-bottom: 14px; }
.search-box input {
  flex: 1; padding: 11px 16px; border: 1.5px solid #e5d9c6; border-radius: 999px;
  font-size: 14px; outline: none; background: #fffdf9;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,193,96,.12); }
.empty { text-align: center; color: var(--text-2); font-size: 13px; padding: 42px 0; line-height: 1.8; }

/* ================= 横幅 ================= */
.banner {
  background:
    radial-gradient(160px 90px at 92% 12%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(120px 80px at 6% 88%, rgba(255,255,255,.4), transparent 70%),
    linear-gradient(120deg, #ffe7c2, #ffd3d8);
  border-radius: 18px; padding: 18px; margin-bottom: 16px;
  position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), var(--shadow-card);
}
.banner h2 { font-size: 17px; color: #7a4a1d; font-weight: 800; }
.banner p { font-size: 12px; color: #9a6a3d; margin-top: 5px; line-height: 1.7; }
.section-title {
  font-size: 15px; font-weight: 800; margin: 8px 2px 12px;
  display: flex; align-items: center; gap: 7px;
}
.section-title::before {
  content: ''; width: 5px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #c08a4e, #8a5a2b);
}

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(43,33,24,.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
  animation: maskIn .2s ease both;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fffdf9; width: 100%; max-width: 480px;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto;
  animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1.1) both;
  position: relative;
}
.modal::before {
  content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px; background: #eadfd0;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
.modal h3 { font-size: 16px; margin-bottom: 14px; font-weight: 800; }
.modal .detail-line {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 7px 0; border-bottom: 1px dashed #f0e6d8;
}
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .btn { flex: 1; padding: 12px; border-radius: 12px; font-size: 14px; }

/* ================= Toast ================= */
.toast {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(43,33,24,.82); color: #fff; padding: 12px 24px;
  border-radius: 999px; font-size: 14px; z-index: 200; max-width: 80%;
  text-align: center; line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toastIn .25s ease both;
  backdrop-filter: blur(6px);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%,-46%); } to { opacity: 1; transform: translate(-50%,-50%); } }

/* ================= 后台专用 ================= */
.admin-header {
  background: linear-gradient(135deg, #33465c, #1b2a3a);
  color: #fff; padding: 18px 16px; position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 14px rgba(20,32,46,.3);
}
.admin-header h1 { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.voice-toggle { font-size: 12px; }
.order-new { border-left: 4px solid var(--red); }
.order-done { opacity: .7; border-left: 4px solid var(--green); }
.order-done .card-inner { opacity: .9; }
.tag {
  display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--tea-light); color: var(--tea); margin-right: 4px; font-weight: 700;
}
.tag.new {
  background: linear-gradient(135deg, #ffe3e0, #ffd0cc); color: var(--red);
  box-shadow: 0 2px 6px rgba(232,67,62,.18);
}
.tag.done { background: linear-gradient(135deg, #e2f9ec, #cdf3dd); color: #058b4c; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-form-grid .full { grid-column: 1 / -1; }
.mini-btn {
  border: none; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
  font-weight: 600; transition: all .15s;
}
.mini-btn:active { transform: scale(.94); }
.mini-btn.edit { background: #e8f0fe; color: #1a66d2; }
.mini-btn.del { background: #ffe9e7; color: var(--red); }
.mini-btn.done { background: #e2f9ec; color: #058b4c; }
.mini-btn.speak { background: #fff4dd; color: #b45309; }
.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px;
  background: #f4eee3; color: #8a6d4b; font-weight: 600;
}

/* ================================================================
   v3 精致化：支付状态、动效、纹理、细节打磨
   ================================================================ */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(138, 90, 43, .055) 1px, transparent 1.4px);
  background-size: 24px 24px;
}

/* 页头漂浮珍珠气泡 */
.app-header .bubble {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.6), rgba(255,255,255,.12));
  animation: floatY 3.6s ease-in-out infinite;
}
.app-header .b1 { width: 13px; height: 13px; top: 18px; left: 56%; }
.app-header .b2 { width: 9px;  height: 9px;  top: 42px; left: 70%; animation-delay: .9s; }
.app-header .b3 { width: 6px;  height: 6px;  top: 26px; left: 82%; animation-delay: 1.5s; }
.app-header .b4 { width: 8px;  height: 8px;  top: 60px; left: 62%; animation-delay: 2.1s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); opacity: .65; }
  50%      { transform: translateY(-8px); opacity: 1; }
}

/* 卡片微交互（桌面 hover） */
.card { transition: transform .18s ease, box-shadow .18s ease; }
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(120, 84, 40, .11); }
}

/* 主按钮顶部高光 */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(140px 34px at 28% -6%, rgba(255,255,255,.4), transparent 62%);
}

/* 滑条选中行：轨道转为浅绿渐变，呼应绿色圆钮 */
.mat-row.active input[type=range] {
  background: linear-gradient(90deg, #c9eecf, #e8e0d2);
}

/* 排行榜前三名脉冲光环 */
.rank-1, .rank-2, .rank-3 { position: relative; }
.rank-1::after, .rank-2::after, .rank-3::after {
  content: ''; position: absolute; inset: -3px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.75); opacity: .45;
  animation: ringPulse 2.2s ease-in-out infinite;
}
.rank-2::after, .rank-3::after { animation-delay: .7s; }
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .45; }
  50%      { transform: scale(1.18); opacity: 0; }
}

/* 待付款（pending）状态：琥珀金 */
.tag.pending {
  background: linear-gradient(135deg, #fff3d6, #ffe3ab); color: #b45309;
  box-shadow: 0 2px 6px rgba(245, 158, 11, .22);
}
.order-pending {
  border-left: 4px solid var(--gold);
  background: linear-gradient(180deg, #fffdf6, #fff9ec);
}

/* 空状态：大图标插画 */
.empty { position: relative; }
.empty::before {
  content: '🧋'; display: block; font-size: 42px; margin-bottom: 10px;
  filter: grayscale(.3); opacity: .85;
  animation: floatY 2.8s ease-in-out infinite;
}

/* 横幅：杯盖装饰 */
.banner::after {
  content: '🥤'; position: absolute; right: 12px; bottom: -10px;
  font-size: 52px; transform: rotate(-14deg); opacity: .22; pointer-events: none;
}

/* 滚动条细化 */
main::-webkit-scrollbar, .modal::-webkit-scrollbar { width: 4px; height: 4px; }
main::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb {
  background: #dccbb0; border-radius: 2px;
}

/* 汇总条价格呼吸光 */
.summary-bar .total {
  animation: priceGlow 2.6s ease-in-out infinite;
}
@keyframes priceGlow {
  0%, 100% { text-shadow: 0 1px 0 rgba(255,255,255,.6); }
  50%      { text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 0 14px rgba(232,67,62,.28); }
}

/* 支付宝收款码展示卡片 */
.qr-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(0,102,255,.12), 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid #e0ecff;
  max-width: 300px;
  margin: 0 auto;
  animation: qrPop .45s cubic-bezier(.22,1,.36,1);
}
@keyframes qrPop {
  0% { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
