:root {
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-dark: #1D4ED8;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #F3F4F6;
  --card: #FFFFFF;
  --text: #111827;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* ===== App Shell ===== */
.app-container {
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.page {
  display: none;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  min-height: 100vh;
  animation: fadeIn 0.25s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: none;
  background: none;
  font-size: 10px;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 24px; height: 24px; }
.nav-item .badge {
  position: absolute;
  top: -2px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ===== Header ===== */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 50%, #6366F1 100%);
  padding: 16px 16px 24px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ===== Search ===== */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 10px 16px;
  gap: 8px;
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.search-bar svg { flex-shrink: 0; width: 18px; height: 18px; opacity: 0.8; }
.search-bar span { opacity: 0.7; font-size: 14px; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  width: 100%;
}
.search-input::placeholder { color: rgba(255,255,255,0.6); }

/* ===== Banner ===== */
.banner-wrapper {
  margin: -8px 16px 16px;
  position: relative;
  z-index: 5;
}
.banner {
  background: linear-gradient(135deg, #1E3A8A 0%, #312E81 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  transition: background-image 0.5s ease-in-out;
}
.banner.banner-has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.banner.banner-has-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
  z-index: 0;
}
.banner.banner-has-image > * {
  position: relative;
  z-index: 1;
}
.banner h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.banner p { font-size: 13px; opacity: 0.85; line-height: 1.5; }
.banner .tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  margin-top: 10px;
}
.banner-dots {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 12px;
}
.banner-dots span {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(0,0,0,0.15); transition: all 0.3s;
}
.banner-dots span.active { background: var(--primary); width: 18px; }

/* ===== Category Grid ===== */
.section { padding: 0 16px; margin-bottom: 20px; }
.section-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 3px; height: 16px;
  background: var(--primary); border-radius: 2px;
}
.section-more {
  margin-left: auto; font-size: 12px; color: var(--text-secondary);
  font-weight: 400; cursor: pointer;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.category-item:active { transform: scale(0.96); }
.category-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.category-name { font-size: 12px; font-weight: 500; color: var(--text); text-align: center; }

/* ===== Hot List ===== */
.hot-list { display: flex; flex-direction: column; gap: 10px; }
.hot-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.hot-item:active { background: var(--bg); }
.hot-thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.hot-info { flex: 1; min-width: 0; }
.hot-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hot-info .desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-info .meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-light); }
.hot-info .meta .score { color: var(--warning); }
.hot-price { text-align: right; flex-shrink: 0; }
.hot-price .price { font-size: 18px; font-weight: 700; color: var(--danger); }
.hot-price .unit { font-size: 12px; color: var(--text-light); }
.hot-price .orig { font-size: 11px; color: var(--text-light); text-decoration: line-through; }

/* ===== Category Page ===== */
.cat-tabs {
  display: flex; gap: 8px; padding: 12px 16px;
  overflow-x: auto; white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  transition: all 0.2s; border: none;
  background: var(--bg); color: var(--text-secondary);
}
.cat-tab.active { background: var(--primary); color: #fff; }

.cat-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ===== Detail Page ===== */
.detail-header {
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%);
  padding: 40px 16px 24px;
  color: #fff;
  position: relative;
}
.detail-back {
  position: absolute; top: 12px; left: 12px;
  width: 36px; height: 36px;
  border-radius: 18px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; color: #fff;
}
.detail-title { font-size: 20px; font-weight: 700; margin: 8px 0 4px; }
.detail-subtitle { font-size: 13px; opacity: 0.85; }

.detail-body { padding: 16px; background: var(--bg); }
.param-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.param-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.param-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.param-row:last-child { border-bottom: none; }
.param-label { font-size: 14px; color: var(--text); }
.param-options { display: flex; gap: 8px; flex-wrap: wrap; }
.param-option {
  padding: 5px 14px; border-radius: 16px;
  font-size: 12px; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  transition: all 0.2s;
}
.param-option.selected { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.param-desc {
  margin-top: 10px; padding: 10px 12px;
  background: var(--bg); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
}

.detail-footer {
  position: sticky; bottom: 0;
  background: var(--card);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.detail-foot-price { flex: 1; }
.detail-foot-price .label { font-size: 11px; color: var(--text-light); }
.detail-foot-price .val { font-size: 24px; font-weight: 700; color: var(--danger); }
.detail-foot-price .val small { font-size: 14px; font-weight: 400; }

.btn { border: none; border-radius: 24px; padding: 12px 28px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); transform: scale(0.97); }
.btn-outline { background: var(--card); color: var(--primary); border: 1px solid var(--primary); }
.btn-block { width: 100%; text-align: center; padding: 14px; font-size: 16px; }

/* ===== Order Page ===== */
.order-section {
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 16px;
}
.order-section h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.form-label .required { color: var(--danger); }
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; background: var(--bg);
  transition: border 0.2s;
}
.form-input:focus { border-color: var(--primary); }
.form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; background: var(--bg);
  resize: none; font-family: inherit;
  min-height: 80px;
}
.form-textarea:focus { border-color: var(--primary); }

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-item {
  padding: 8px 16px; border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s; background: var(--card);
  white-space: nowrap;
}
.radio-item.selected { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.radio-item .circle {
  width: 16px; height: 16px; border-radius: 8px;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.radio-item.selected .circle { border-color: var(--primary); }
.radio-item.selected .circle::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 4px; background: var(--primary);
}

.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.file-upload:hover { border-color: var(--primary); background: var(--primary-light); }
.file-upload .icon { font-size: 32px; margin-bottom: 6px; }
.file-upload .text { font-size: 12px; color: var(--text-secondary); }
.file-upload .hint { font-size: 10px; color: var(--text-light); margin-top: 4px; }
.file-list { margin-top: 8px; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg);
  border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 4px;
}
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.file-item .file-size { color: var(--text-light); font-size: 11px; }
.file-item .file-icon { font-size: 16px; }
.file-item .remove { margin-left: auto; color: var(--danger); cursor: pointer; font-size: 18px; }

.order-summary { font-size: 14px; }
.order-summary .row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
}
.order-summary .row:last-child {
  border-top: 1px solid var(--border);
  padding-top: 10px; margin-top: 4px;
  font-weight: 700; font-size: 16px;
}
.order-summary .row:last-child .val { color: var(--danger); }

/* ===== Orders Page ===== */
.order-tabs {
  display: flex; gap: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.order-tab {
  flex: 1; text-align: center;
  padding: 14px 0; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.order-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.order-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.order-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.order-card:active { background: var(--bg); }
.order-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.order-card-header .name { font-size: 14px; font-weight: 600; }
.order-card-header .status {
  font-size: 12px; padding: 3px 10px; border-radius: 10px;
  font-weight: 500;
}
.status-pending { background: #FEF3C7; color: #B45309; }
.status-received { background: #EDE9FE; color: #6D28D9; }
.status-testing { background: #DBEAFE; color: #1D4ED8; }
.status-done { background: #D1FAE5; color: #065F46; }
.status-cancel { background: #FEE2E2; color: #991B1B; }
.order-card-body { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.order-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.order-card-footer .time { font-size: 11px; color: var(--text-light); }
.order-card-footer .amount { font-size: 16px; font-weight: 700; color: var(--danger); }
.order-card-footer .amount small { font-size: 12px; font-weight: 400; }

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== Profile Page ===== */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%);
  padding: 32px 16px 24px;
  color: #fff;
}
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 30px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px;
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-dept { font-size: 13px; opacity: 0.85; margin-top: 2px; }

.credit-card {
  margin: -20px 16px 16px;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  z-index: 5;
  box-shadow: var(--shadow-lg);
}
.credit-label { font-size: 12px; opacity: 0.7; margin-bottom: 6px; }
.credit-amount { font-size: 32px; font-weight: 700; }
.credit-amount .unit { font-size: 16px; font-weight: 400; }
.credit-used { font-size: 12px; opacity: 0.6; margin-top: 6px; }

.menu-list { margin: 0 16px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.menu-text { flex: 1; }
.menu-text .title { font-size: 14px; font-weight: 500; }
.menu-text .sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.menu-arrow { color: var(--text-light); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 200;
}
.modal-overlay.show { display: flex; }
.modal-sheet {
  width: 100%; max-width: 430px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  animation: slideUp 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-content { padding: 20px 16px; }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 16px; }

/* ===== Privacy Checkbox ===== */
#privacyCheckbox, #orderAgreeCheckbox, #regAgreeCheckbox {
  cursor: pointer;
  accent-color: var(--primary);
}
#privacyModal .modal-sheet { max-height: 90vh; }
#privacyDocContent h3 { margin-bottom: 4px; }
#privacyDocContent p { margin-bottom: 6px; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== Misc ===== */
.tag-hot {
  display: inline-block;
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  color: #DC2626;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 6px;
}

.section-divider { height: 8px; background: var(--bg); margin: 0 -16px; }

/* ===== Auth Page ===== */
.auth-tabs {
  display: flex; margin: 0 16px;
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.auth-tab {
  flex: 1; padding: 14px;
  text-align: center; font-size: 15px; font-weight: 600;
  border: none; background: none; cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-form { padding: 20px 16px; }

/* ===== User Role Tags ===== */
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row-info { display: flex; align-items: center; gap: 10px; }
.user-row-avatar { font-size: 24px; }
.user-row-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.user-row-dept { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.user-role-tag {
  font-size: 10px; padding: 1px 8px; border-radius: 10px;
  font-weight: 500; display: inline-block;
}
.role-admin { background: #FEE2E2; color: #991B1B; }
.role-researcher { background: #DBEAFE; color: #1D4ED8; }
.role-user { background: #F3F4F6; color: #6B7280; }

.user-row-actions { flex-shrink: 0; display: flex; gap: 6px; align-items: center; }
.btn-credit {
  padding: 6px 10px; font-size: 12px; font-weight: 500;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
}
.btn-credit:hover { border-color: var(--primary); color: var(--primary); }
.credit-log-item {
  padding: 8px 10px; border-radius: 8px; background: var(--bg);
  margin-bottom: 6px; border-left: 3px solid var(--border);
}
label:has(input[name="creditMode"]:checked) {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 600;
  background: rgba(30, 58, 138, 0.05);
}
.role-select {
  padding: 6px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text);
  cursor: pointer; outline: none;
}
.role-select:focus { border-color: var(--primary); }

/* ===== Admin Tabs ===== */
.admin-tabs {
  display: flex; gap: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-tab {
  flex-shrink: 0; text-align: center;
  padding: 12px 14px; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ===== Admin Item Table ===== */
.item-table {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}
.item-table-row {
  display: flex; align-items: center;
  padding: 12px 14px; gap: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background 0.15s;
}
.item-table-row:last-child { border-bottom: none; }
.item-table-row:hover { background: var(--bg); }
.item-table-row .item-icon { font-size: 24px; flex-shrink: 0; width: 36px; text-align: center; }
.item-table-row .item-info { flex: 1; min-width: 0; }
.item-table-row .item-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.item-table-row .item-meta { font-size: 11px; color: var(--text-light); display: flex; gap: 12px; }
.item-table-row .item-price { font-weight: 700; color: var(--danger); font-size: 14px; white-space: nowrap; }
.item-table-row .item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.item-table-row .item-actions button {
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; cursor: pointer; border: 1px solid var(--border);
  background: var(--card); color: var(--text-secondary);
  transition: all 0.15s;
}
.item-table-row .item-actions .btn-edit:hover { border-color: var(--primary); color: var(--primary); }
.item-table-row .item-actions .btn-del:hover { border-color: var(--danger); color: var(--danger); }
.item-table-row .item-actions .btn-hot {
  padding: 4px 8px; font-size: 14px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card); cursor: pointer;
  opacity: 0.4; transition: all 0.2s;
}
.item-table-row .item-actions .btn-hot.active {
  opacity: 1; border-color: #F59E0B; background: #FEF3C7;
}
.item-table-row .item-actions .btn-hot:hover { opacity: 1; }

/* ===== Param Row (in item form) ===== */
.param-row {
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 8px; padding: 8px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.param-row input {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; outline: none; background: #fff;
}
.param-row input:focus { border-color: var(--primary); }
.param-row .param-remove {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: #FEE2E2; color: var(--danger); border: none; border-radius: 6px;
  cursor: pointer; font-size: 14px; flex-shrink: 0;
}

/* ===== Order Stats Bar ===== */
.order-stats-bar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 0 16px 12px;
}
.order-stat-card {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 12px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.order-stat-card .stat-value {
  font-size: 18px; font-weight: 700; color: var(--primary);
  margin-bottom: 2px;
}
.order-stat-card .stat-label {
  font-size: 11px; color: var(--text-light);
}
.order-stat-card.highlight .stat-value { color: var(--danger); }

/* ===== Order Search ===== */
.order-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
}
.order-search-bar svg { width: 16px; height: 16px; color: var(--text-light); flex-shrink: 0; }
.order-search-input {
  flex: 1; border: none; outline: none;
  background: none; font-size: 13px; color: var(--text);
}
.order-search-input::placeholder { color: var(--text-light); }

/* ===== Order Filter Row ===== */
.order-filter-row {
  display: flex; gap: 6px;
  overflow-x: auto; white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.order-filter-row::-webkit-scrollbar { display: none; }
.order-filter-select,
.order-filter-input {
  padding: 6px 10px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text);
  outline: none; flex-shrink: 0;
  max-width: 120px;
}
.order-filter-select:focus,
.order-filter-input:focus { border-color: var(--primary); }
.order-filter-input[type="date"] { padding: 5px 8px; font-size: 11px; }
.order-filter-input[type="number"] { width: 70px; }

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 16px 24px;
}
.pagination button {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.pagination button.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.pagination .page-info {
  font-size: 12px; color: var(--text-light);
  padding: 0 8px;
}
.pagination .page-ellipsis {
  font-size: 12px; color: var(--text-light);
  padding: 0 2px;
}

/* ===== Coupon / Ticket Tabs ===== */
.ticket-tabs {
  display: flex; gap: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.ticket-tab {
  flex: 1; text-align: center;
  padding: 12px 0; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.ticket-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.ticket-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ===== Coupon Card ===== */
.coupon-card {
  display: flex; background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.coupon-left {
  flex: 1; padding: 16px;
  background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  border-right: 2px dashed var(--border);
}
.coupon-value { font-size: 24px; font-weight: 700; color: #D97706; }
.coupon-name { font-size: 13px; font-weight: 600; margin-top: 4px; color: #92400E; }
.coupon-cond { font-size: 11px; color: #B45309; margin-top: 4px; }
.coupon-right {
  width: 100px; padding: 16px 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 6px;
}
.coupon-status { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.coupon-date { font-size: 10px; color: var(--text-light); }
.coupon-remain { font-size: 11px; color: var(--text-secondary); }
.coupon-use-btn {
  padding: 5px 14px; border-radius: 14px;
  border: 1px solid var(--primary); background: var(--primary);
  color: #fff; font-size: 12px; cursor: pointer;
  transition: all 0.2s;
}
.coupon-use-btn:active { opacity: 0.8; }
.coupon-used .coupon-left { background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%); }
.coupon-used .coupon-value, .coupon-used .coupon-name, .coupon-used .coupon-cond { opacity: 0.5; }
.coupon-expired .coupon-left { background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%); }

/* ===== Invoice Card ===== */
.invoice-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.invoice-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.invoice-title { font-size: 14px; font-weight: 600; }
.invoice-body { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }

/* ===== Team Card ===== */
.team-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: all 0.2s;
}
.team-card:active { background: var(--bg); }
.team-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.team-name { font-size: 15px; font-weight: 600; }
.team-role { font-size: 11px; padding: 2px 10px; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-weight: 500; }
.team-card-body { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 0; }
.faq-item {
  padding: 12px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 13px; font-weight: 500; color: var(--text); display: flex; justify-content: space-between; }
.faq-a {
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
  margin-top: 6px; display: none;
}
.faq-item.open .faq-a { display: block; }

/* ===== Ticket Item ===== */
.ticket-item {
  padding: 12px; background: var(--bg); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.ticket-item:last-child { margin-bottom: 0; }

/* ===== MyData Chart Placeholder ===== */
#mydataChart > div { transition: height 0.3s; }

/* ===== Layout Alignment Fixes ===== */
/* Ensure demo banner stays within container width */
#demoBanner {
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure body has no horizontal scroll */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== Admin Ticket Stats ===== */
#adminTicketStats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
#adminTicketStats .stat-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
#adminTicketStats .stat-num {
  font-size: 18px;
  font-weight: 700;
}
#adminTicketStats .stat-label {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ===== Admin Banner Card ===== */
.banner-admin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.banner-admin-img {
  width: 80px;
  height: 50px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: var(--bg);
}
.banner-admin-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(135deg, #1E3A8A 0%, #312E81 100%);
  overflow: hidden;
  padding: 2px;
  text-align: center;
}
.banner-admin-img-placeholder span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.banner-admin-info {
  flex: 1;
  min-width: 0;
}
.banner-admin-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-admin-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.banner-admin-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-light);
  flex-wrap: wrap;
}
.banner-admin-tag {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Ensure bottom-nav aligns with app-container */
.bottom-nav {
  box-sizing: border-box;
}
