:root {
  --bg: #f5f9ff;
  --card: #ffffff;
  --text: #19233f;
  --muted: #65738f;
  --line: #dfeaff;
  --primary: #2d78ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", Arial, sans-serif;
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button {
  width: 100%;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}
button {
  border: 0;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.hidden { display: none; }
.muted { color: var(--muted); font-size: 12px; }
.list { margin-top: 10px; max-height: 340px; overflow: auto; }
.item {
  border: 1px solid #deebff;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fafdff;
}

/* home */
.mobile-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px;
}
.home-header {
  padding: 10px 10px 14px;
  border: 1px solid #d9e8ff;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #edf4ff 100%);
}
.home-header h1 {
  margin: 8px 0 6px;
  font-size: 40px;
  letter-spacing: 1px;
}
.home-header p { margin: 0; color: var(--muted); }
.home-brand {
  color: #6f7e98;
  letter-spacing: 4px;
  font-size: 13px;
  font-weight: 600;
}
.menu-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  margin: 12px 0;
  box-shadow: 0 5px 14px rgba(89, 130, 201, 0.08);
}
.menu-icon-wrap {
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  border-radius: 20px;
  border: 1px solid #dce8ff;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.menu-icon {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 16px;
}
.menu-blue-strong { background: linear-gradient(135deg, #eaf2ff 0%, #f7fbff 100%); }
.menu-blue-soft { background: #f7fbff; }
.menu-blue { background: #f3f8ff; }

.home-promo-wrap {
  margin: 12px 0;
}
.home-promo-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 5px 14px rgba(89, 130, 201, 0.08);
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}
.home-promo-card img {
  display: block;
  width: 100%;
  height: auto;
}
.menu-left { flex: 1; min-width: 0; }
.menu-left h3 { margin: 0; font-size: 31px; }
.menu-left p { margin: 7px 0; color: var(--muted); font-size: 20px; }
.menu-left strong { color: #2d78ff; font-size: 19px; }
.menu-badge-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ffefcc;
  color: #8b6118;
  font-size: 12px;
  font-weight: 700;
}
.menu-btn {
  margin-left: auto;
  width: auto;
  padding: 11px 20px;
  border-radius: 14px;
  background: #2d78ff;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.menu-btn.ghost {
  background: #f8fbff;
  color: #3176ea;
  border: 1px solid #d2e2ff;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}
.panel h4 { margin: 0 0 8px; font-size: 15px; }

/* admin shared */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 16px; margin-top: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(40, 100, 200, .07);
}
body.admin-page {
  background: linear-gradient(165deg, #eef4ff 0%, #f8fbff 40%, #ffffff 100%);
}
.admin-preset-card .admin-preset-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-preset-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}
.admin-preset-sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.admin-form-grid .span2 {
  grid-column: 1 / -1;
}
.admin-field > span:first-child {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.admin-preset-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.admin-preset-toolbar select {
  width: auto;
  min-width: 140px;
}
.admin-preset-toolbar .admin-btn-primary {
  margin-right: auto;
}
.admin-btn-primary {
  width: auto;
  padding: 10px 22px;
  border-radius: 12px;
}

/* pdd/kl */
.page-head {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.page-head h2 { margin: 2px 0 6px; font-size: 24px; }
.action-row { display: flex; gap: 8px; }
.action-row > * { flex: 1; }
.pdd-submit-row #pddTokenInput {
  flex: 1 1 auto;
  min-width: 0;
}
.pdd-submit-row .pdd-submit-btn,
.pdd-submit-row .pdd-ocr-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 74px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}
.token-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.token-code {
  font-size: 28px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #1f8761;
}
.token-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #396fd8;
  font-size: 12px;
  margin-left: 4px;
}
.pdd-page .mobile-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.pdd-page .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.pdd-page #pddList.list {
  flex: 1;
  max-height: none;
  overflow: auto;
}
.pdd-stats-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #5b96ff;
  background: linear-gradient(135deg, #2f79ff 0%, #4b92ff 100%);
  box-shadow: 0 8px 18px rgba(47, 121, 255, 0.22);
}
.pdd-stats-item {
  text-align: center;
  padding: 16px 8px 14px;
}
.pdd-stats-item + .pdd-stats-item {
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.pdd-stats-value {
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.pdd-stats-label {
  color: rgba(255, 255, 255, 0.92);
  margin-top: 8px;
  font-size: 17px;
}
.pdd-action-btn {
  width: auto;
  min-width: 88px;
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(180deg, #3b86ff 0%, #2d78ff 100%);
  color: #fff;
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(45, 120, 255, 0.25);
}
.pdd-action-btn-used {
  background: #e9f0fb;
  color: #7b98c9;
  box-shadow: none;
  cursor: not-allowed;
}
.jd-token-tip {
  margin: 8px 0 6px;
  color: #237b49;
  font-size: 13px;
}
.jd-token-tip.error {
  color: #ba2f3a;
}
.jd-extra-panel {
  border: 1px solid #d7e6ff;
  border-radius: 12px;
  background: #f7fbff;
  padding: 10px;
  margin-bottom: 10px;
}
.jd-extra-title {
  font-size: 13px;
  color: #587093;
  margin-bottom: 6px;
}
.jd-option-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.jd-type-btn,
.jd-use-btn {
  width: auto;
  padding: 8px 10px;
  flex: 0 0 auto;
}
.jd-type-btn.is-active,
.jd-use-btn.is-active {
  background: #2d78ff;
  color: #fff;
  border-color: #2d78ff;
}
.jd-token-item {
  border-left: 4px solid #8bd5a8;
  position: relative;
}
.jd-token-item-used {
  border-left-color: #c9d4e8;
  opacity: 0.92;
}
.jd-main-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jd-platform-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2b300;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.jd-preset-center-title {
  color: #cc2b2b;
  font-weight: 800;
  border-color: #f0b2b2;
  background: #fff0f0;
}
.jd-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.jd-action-group {
  display: flex;
  gap: 8px;
}
.jd-act-btn {
  width: auto;
  min-width: 64px;
  padding: 6px 12px;
}
.jd-token-item-used .jd-act-btn {
  background: #eef0f4;
  color: #8b95a8;
  border-color: #d8dde6;
}
.jd-token-item-used .jd-act-btn:hover {
  background: #e4e7ee;
  color: #7a8496;
  border-color: #cdd3df;
}
.jd-use-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.jd-use-mask {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 45, 0.35);
}
.jd-use-dialog {
  position: relative;
  width: min(92vw, 520px);
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe7ff;
  padding: 16px;
  box-shadow: 0 14px 36px rgba(30, 60, 120, 0.22);
}
.jd-use-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: auto;
  border: 0;
  padding: 2px 8px;
  background: transparent;
  color: #8b9ab6;
  font-size: 30px;
  line-height: 1;
}
.jd-use-dialog h3 {
  margin: 4px 0 12px;
  text-align: center;
  font-size: 36px;
}
.jd-use-dialog h3.jd-use-modal-title {
  margin: 4px 0 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #0f203f;
}
.jd-modal-actions-split {
  flex-wrap: wrap;
}
.jd-modal-btn-accent {
  background: #07c160 !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.35);
}
.jd-modal-btn-accent:hover {
  filter: brightness(1.05);
}
.jd-modal-footer-preset {
  flex-direction: column;
  align-items: stretch;
}
.jd-modal-footer-preset .jd-modal-btn:last-child {
  width: 100%;
}
.jd-preset-direct-tag {
  background: #e8f4ff;
  color: #2067d6;
  border-color: #c5dcf9;
}
.jd-use-tip {
  color: #0f203f;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}
.jd-use-warn {
  color: #a46218;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}
.jd-use-content-title {
  color: #7585a3;
  margin-bottom: 4px;
}
.jd-use-content {
  border: 1px solid #d9e5ff;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  font-size: 20px;
  color: #243558;
  word-break: break-all;
  margin-bottom: 10px;
}
.jd-use-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.jd-modal-btn {
  flex: 1;
  width: auto;
  font-weight: 700;
}
.jd-return-btn {
  color: #aa6a22;
  border-color: #e5c79d;
  background: #fff9f1;
}
.waimai-page .list {
  max-height: none;
  overflow: visible;
}
.waimai-available-title {
  color: #d53b3b;
}
.waimai-list-loading {
  text-align: center;
  padding: 14px 10px;
  font-size: 15px;
}

.jiake-top-home-bar {
  position: sticky;
  top: 0;
  z-index: 10001;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  background: linear-gradient(180deg, #eaf2ff 0%, #f7fbff 100%);
  border-bottom: 1px solid var(--line);
}
.jiake-top-home-btn {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: block;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid #d2e2ff;
  background: #fff;
  color: #3176ea;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.jiake-top-home-btn:active {
  opacity: 0.92;
}

@media (max-width: 520px) {
  .home-header h1 { font-size: 19px; }
  .menu-card { gap: 10px; }
  .menu-icon-wrap {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
    border-radius: 14px;
  }
  .menu-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }
  .menu-left h3 { font-size: 17px; }
  .menu-left p { font-size: 14px; }
  .menu-left strong { font-size: 14px; }
  .menu-btn { font-size: 14px; }
  .token-code { font-size: 21px; }
  .pdd-stats-value { font-size: 28px; }
  .pdd-stats-label { font-size: 15px; }
  .pdd-action-btn { min-width: 72px; height: 38px; font-size: 17px; }
}