:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --navy: #1c2541;
  --navy-hover: #141b31;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --red: #dc2626;
  --green: #15803d;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --ring: rgba(59, 130, 246, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* 登录页 */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-brand-name {
  font-size: 16px;
  font-weight: 700;
}

.login-title {
  margin: 22px 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.login-subtitle {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--muted);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.login-form input,
.input-control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.login-form input:focus,
.input-control:focus,
.stall-input:focus,
.select-control:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px var(--ring);
}

.login-footer {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.error-banner {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-full {
  width: 100%;
  height: 42px;
}

/* 顶部深蓝导航条 */
.topbar {
  background: var(--navy);
  color: #fff;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.who-code {
  font-size: 13.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  cursor: pointer;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 主菜单栏 */
.main-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.main-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 28px;
  overflow-x: auto;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 13px 2px 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab.active {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--navy);
}

/* 主内容容器 */
.page-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

.page-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-head-col {
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.page-sub {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.meta-pill {
  font-size: 12.5px;
  background: #e2e8f0;
  color: #334155;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.meta-muted {
  font-size: 12.5px;
  color: var(--muted);
}

/* 汇率条 */
.rate-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--blue-soft);
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 11px 16px;
  margin-bottom: 14px;
  cursor: pointer;
  font-family: inherit;
}

.rate-strip:hover {
  background: #e0edff;
}

.rate-strip-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rate-strip-label {
  font-size: 13px;
  color: var(--muted);
}

.rate-strip-val {
  font-size: 15px;
  color: var(--text);
}

.rate-strip-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

/* 筛选工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.filter-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.seg-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.select-control {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
}

.custom-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 按天分组的订单 + 纸质小票账单 */
.days-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 16px;
}

.day-title {
  font-size: 17px;
  font-weight: 700;
}

.day-count {
  font-size: 13px;
  color: var(--muted);
}

.day-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr);
  gap: 18px;
  align-items: start;
}

.orders-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.thumb-btn {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  background: #f8fafc;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 10.5px;
  text-align: center;
  padding: 1px 0;
}

.order-main {
  flex: 1;
  min-width: 0;
}

.order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.order-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stall-code {
  font-weight: 700;
  font-size: 15px;
}

.brand-label {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
}

.status-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.badge-已到齐 { background: var(--green-soft); color: var(--green); }
.badge-预定中 { background: var(--amber-soft); color: var(--amber); }

.order-krw {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.order-qty-row {
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
}

.order-note {
  font-size: 12.5px;
  color: var(--amber);
  margin-bottom: 6px;
}

.shipped-banner {
  background: var(--green-soft);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.inspect-row {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

/* 右侧纸质小票样式当日账单 */
.receipt-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  padding: 18px 18px 24px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.receipt-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  background: radial-gradient(circle at 8px 0, #fff 6px, transparent 6.5px) repeat-x;
  background-size: 16px 8px;
}

.receipt-stamp {
  position: absolute;
  right: 96px;
  top: 14px;
  padding: 2px 10px;
  border: 2px solid var(--red);
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  border-radius: 4px;
  transform: rotate(-10deg);
  opacity: 0.85;
  pointer-events: none;
}

.receipt-stamp.settled {
  border-color: var(--green);
  color: var(--green);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 12px;
}

.receipt-head strong {
  font-size: 15px;
}

.receipt-head span {
  font-size: 12.5px;
  color: var(--muted);
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 4px 0;
  color: #334155;
}

.receipt-divider {
  border-top: 1px dashed var(--border);
  margin: 10px 0;
}

.receipt-total-rmb {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 0;
}

.receipt-unpaid {
  color: var(--red);
  font-weight: 700;
}

/* 我的账单 KPI 与表格 */
.bills-kpi-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
}

.kpi-red {
  color: var(--red);
}

.kpi-helper {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 12px;
}

.card-surface {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.bills-table tbody tr {
  cursor: pointer;
}

.bills-table tbody tr:hover {
  background: #f8fafc;
}

.rate-pill-btn {
  margin-left: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.status-unpaid {
  color: var(--red);
  font-weight: 700;
}

.status-settled {
  color: var(--green);
  font-weight: 600;
}

.table-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 每日汇率 */
.rates-top-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.rate-hero {
  font-size: 40px;
  font-weight: 800;
  color: var(--navy);
  margin: 6px 0;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.rate-chart-box {
  width: 100%;
  height: 150px;
}

.rate-thumb {
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  vertical-align: middle;
}

/* 查档口 */
.stall-search-wrap {
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin-bottom: 20px;
}

.stall-combobox {
  position: relative;
  flex: 1;
}

.stall-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.stall-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 46px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
}

.stall-option {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13.5px;
}

.stall-option:hover {
  background: #f8fafc;
}

.stall-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.stall-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.stall-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.stall-card-loc {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.stall-card-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* 账号 */
.account-summary-card {
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.password-card {
  max-width: 460px;
}

.section-subtitle {
  margin: 0 0 14px;
  font-size: 16px;
}

/* 灯箱与弹窗 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 86vh;
  border-radius: 12px;
  background: #fff;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
}

.modal-body {
  padding: 16px 20px 20px;
}

.pay-dates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.pay-date-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13.5px;
}

.pay-sum-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 14px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group label.upload-btn {
  display: inline-flex;
  margin-bottom: 0;
  color: var(--text);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  z-index: 100;
}

@media (max-width: 920px) {
  .day-body {
    grid-template-columns: 1fr;
  }
  .bills-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rates-top-grid,
  .admin-import-grid {
    grid-template-columns: 1fr;
  }
}

.admin-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 600px) {
  .bills-kpi-grid {
    grid-template-columns: 1fr;
  }
}
