* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --app-bg: #eef7ff;
  --app-bg-2: #f8fbff;
  --surface: #ffffff;
  --surface-soft: #f6fbff;
  --line: #e2eefb;
  --line-strong: #cfe3f7;
  --text: #18324a;
  --muted: #6b8196;
  --muted-2: #9aadc0;
  --primary: #2388ff;
  --primary-2: #52b7ff;
  --primary-soft: #e8f4ff;
  --green: #29c287;
  --green-soft: #e8fbf3;
  --orange: #ff9f43;
  --orange-soft: #fff5e7;
  --purple: #8b7cff;
  --purple-soft: #f0eeff;
  --red: #ff5d6c;
  --red-soft: #fff0f2;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(42, 116, 184, 0.10);
  --shadow-soft: 0 6px 18px rgba(42, 116, 184, 0.08);
}
html, body { min-height: 100%; }
body {
  font-size: 13px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Roboto, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(82,183,255,0.20), transparent 34%),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 52%, #eef7ff 100%);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
button { transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); }
.text-center { text-align: center; }
.text-gray { color: var(--muted-2); }

/* ── 参考图 2.0 浅蓝管理后台设计系统 ── */
.app-shell { display: flex; height: 100vh; overflow: hidden; background: transparent; }
.app-sidebar {
  width: 218px; flex-shrink: 0; height: 100vh; overflow-y: auto;
  background: rgba(255,255,255,0.86);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 30px rgba(61,130,190,.08);
  backdrop-filter: blur(18px);
  display: flex; flex-direction: column;
}
.app-brand { padding: 16px 16px 12px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.app-logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; box-shadow: 0 10px 22px rgba(35,136,255,.24);
}
.app-brand-title { font-size: 13px; font-weight: 900; letter-spacing: .2px; color: #1b4264; }
.app-brand-sub { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.app-user-mini { margin: 10px 12px 6px; padding: 8px; border-radius: 13px; background: linear-gradient(135deg, #f4fbff, #fff); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.app-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #65b8ff, #a9dcff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: 0 8px 18px rgba(35,136,255,.18); }
.sidebar-group { padding: 4px 10px; }
.sidebar-title { padding: 7px 9px 4px; font-size: 10px; color: #9ab0c5; font-weight: 800; letter-spacing: .08em; }
.sidebar-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px;
  padding: 7px 10px; border: 0; border-radius: 10px; text-align: left; cursor: pointer;
  background: transparent; color: #58738c; font-size: 12px; font-weight: 650;
}
.sidebar-item:hover { background: #f2f9ff; color: var(--primary); }
.sidebar-item.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 22px rgba(35,136,255,.20); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-topbar {
  height: 54px; flex-shrink: 0; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255,255,255,.78); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); box-shadow: 0 8px 22px rgba(58,125,186,.06); z-index: 20;
}
.app-topbar-title { font-size: 14px; font-weight: 900; color: #1e4668; display: flex; align-items: center; gap: 8px; }
.app-topbar-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.app-top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 12px; color: var(--muted); cursor: pointer; box-shadow: var(--shadow-soft); }
.app-content { flex: 1; overflow-y: auto; padding: 16px; }
.app-content-wide { max-width: 1360px; margin: 0 auto; }

.hero-dashboard {
  border-radius: 14px; padding: 12px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #eaf6ff 0%, #ffffff 52%, #e9f8ff 100%);
  border: 1px solid rgba(195,226,249,.9); box-shadow: var(--shadow-soft); min-height: 120px;
}
.hero-dashboard:before { content: ''; position: absolute; right: -42px; top: -68px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(82,183,255,.32), transparent 64%); }
.hero-dashboard h1 { font-size: 20px; line-height: 1.18; color: #163d60; margin: 0 0 8px; letter-spacing: -.03em; }
.hero-dashboard p { color: #5d7892; line-height: 1.7; font-size: 12px; max-width: 680px; }
.hero-rocket { position: absolute; right: 38px; top: 20px; font-size: 48px; filter: drop-shadow(0 14px 20px rgba(35,136,255,.18)); transform: rotate(-8deg); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0 20px; }
.feature-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feature-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-icon { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 23px; background: var(--primary-soft); }
.feature-title { font-size: 14px; font-weight: 900; color: var(--text); }
.feature-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.section-title { font-size: 13px; font-weight: 900; color: #1d4263; margin: 14px 0 9px; display: flex; align-items: center; gap: 8px; }

.card, .ui-card, .settings-card {
  background: rgba(255,255,255,.94) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
}
.card { padding: 16px; }
.card h2 { color: #1d4263; font-weight: 900; }
.ui-card { padding: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow-soft); position: relative; overflow: hidden;
}
.stat-card:after { content: ''; position: absolute; right: -22px; top: -28px; width: 64px; height: 64px; border-radius: 50%; background: var(--stat-soft, var(--primary-soft)); }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; position: relative; z-index: 1; }
.stat-value { font-size: 21px; line-height: 1; font-weight: 900; color: #183e60; position: relative; z-index: 1; }
.stat-sub { font-size: 10px; color: var(--muted-2); margin-top: 8px; position: relative; z-index: 1; }
.stat-trend { color: var(--green); font-weight: 900; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-soft); }
.soft-bar { height: 9px; border-radius: 999px; background: #edf6ff; overflow: hidden; }
.soft-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

.btn-primary, .settings-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  color: #fff !important; border: none !important; border-radius: 12px !important;
  box-shadow: 0 10px 22px rgba(35,136,255,.20) !important;
}
.btn-small, .btn-download { border-radius: 10px !important; }
.btn-small { background: #f3f9ff !important; border: 1px solid var(--line) !important; color: #356078 !important; }
.btn-download { background: var(--green-soft) !important; color: #119767 !important; border: 1px solid #bcefdc !important; }
input, select, textarea, .country-selected {
  border-color: var(--line-strong) !important;
  border-radius: 12px !important;
  background: #fff !important;
}
.country-select { position: relative; flex: 0 0 260px; min-width: 240px; max-width: 320px; }
.country-selected { width: 100%; min-height: 40px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line-strong); cursor: pointer; color: var(--text); text-align: left; }
.country-tag { display: flex; align-items: center; gap: 8px; min-width: 0; }
.country-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 3000; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.country-search-wrap { padding: 8px; border-bottom: 1px solid var(--line); }
.country-search { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); }
.country-list { max-height: 260px; overflow-y: auto; padding: 4px; }
.country-item { width: 100%; display: grid; grid-template-columns: 42px 1fr 1.2fr; align-items: center; gap: 8px; padding: 8px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; transform: none !important; }
.country-name-en { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-empty { padding: 18px; color: var(--muted); text-align: center; font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: none !important; border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(35,136,255,.10); }
.country-code { background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important; color: #fff; border-radius: 7px; }
.country-dropdown { border-color: var(--line) !important; border-radius: 16px !important; box-shadow: var(--shadow) !important; }
.country-item:hover, .country-item.active { background: #edf7ff !important; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
thead tr { background: #f2f8ff !important; border-bottom: none; }
th { padding: 9px 8px; text-align: left; font-weight: 800; color: #50708d; font-size: 12px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid #eef5fc; color: #3d5872; }
tbody tr:hover { background: #f8fcff !important; }
.msg-info { padding: 9px 12px; background: #eaf6ff; color: #1d70b7; border: 1px solid #cfe8ff; border-radius: 12px; font-size: 12px; }
.msg-error { margin-top: 12px; padding: 10px; background: var(--red-soft); color: #c7263e; border-radius: 10px; font-size: 14px; text-align: center; }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eaf6ff 0%, #ffffff 55%, #dff3ff 100%); }
.auth-box { background: #fff; padding: 40px; border-radius: 22px; box-shadow: var(--shadow); width: 400px; border: 1px solid var(--line); }
.auth-box h1 { font-size: 22px; margin-bottom: 6px; text-align: center; color: var(--text); }
.auth-box h2 { font-size: 18px; color: var(--muted); margin-bottom: 24px; text-align: center; }
.auth-box input { width: 100%; padding: 12px 16px; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 12px; font-size: 15px; }
.auth-box button { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 800; cursor: pointer; }
.auth-box p { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-box a { color: var(--primary); text-decoration: none; }
.settings-page { display: flex; align-items: flex-start; justify-content: center; padding-top: 40px; }
.settings-tabs { display: flex; border-bottom: 1px solid var(--line); }
.settings-tab { flex: 1; padding: 14px; background: none; border: none; cursor: pointer; font-size: 14px; font-weight: 800; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.settings-body { padding: 24px; }
.settings-input { width: 100%; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; font-size: 14px; outline: none; margin-bottom: 12px; }
.settings-btn-green { background: linear-gradient(135deg, var(--green), #19a974) !important; }
.settings-btn-gray { background: #f3f9ff !important; color: var(--muted) !important; margin-top: 8px; box-shadow: none !important; }
.settings-msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.settings-msg-success { background: var(--green-soft); color: #08724d; }
.settings-msg-error { background: var(--red-soft); color: #991b1b; }
.settings-msg-info { background: var(--primary-soft); color: #1565c0; }

.navbar { background: #fff; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-soft); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--line); }
.nav-brand { font-size: 18px; font-weight: 900; }
.nav-user { display: flex; align-items: center; gap: 16px; font-size: 12px; }
.balance-tag { background: var(--primary-soft); padding: 4px 12px; border-radius: 20px; }
.balance-tag strong { color: var(--primary); }
.dashboard { min-height: 100vh; }
.container { max-width: 1180px; margin: 24px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row input, .row select { padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; font-size: 12px; }
.row input[type=text] { flex: 1; min-width: 150px; }
.row input[type=number] { width: 120px; }
.tip { margin-top: 10px; font-size: 13px; color: var(--muted); }
.recharge-box { margin-top: 16px; padding: 16px; background: #f4faff; border-radius: 14px; text-align: center; border: 1px solid var(--line); }
.recharge-box img { width: 200px; height: 200px; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; }

/* ── 响应式 ── */
@media (max-width: 1180px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-rocket { opacity: .28; } }
@media (max-width: 900px) {
  .app-shell { height: 100dvh; }
  .app-sidebar { display: none; }
  .app-main { width: 100%; }
  .app-topbar { height: auto; min-height: 54px; padding: 8px 12px; gap: 8px; }
  .app-topbar-title { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-topbar-sub { display: none; }
  .app-top-actions { gap: 6px; }
  .top-user-pill span:not(:last-child) { display: none; }
  .app-content { padding: 12px; overflow-x: hidden; }
  .nav-links { display: none !important; }
  .nav-links.open {
    display: flex !important; flex-direction: column; position: absolute; top: 54px; left: 8px; right: 8px;
    max-height: calc(100dvh - 72px); overflow-y: auto; background: #fff; box-shadow: var(--shadow);
    padding: 8px; z-index: 999; border: 1px solid var(--line); border-radius: 16px;
  }
  .nav-links.open a { padding: 12px 14px !important; border-radius: 12px !important; text-decoration: none; font-weight: 800; color: #3d5872; }
  .nav-links.open a:hover { background: #edf7ff; color: var(--primary); }
  .admin-mobile-nav { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-nav-group { min-width: 0; }
  .mobile-nav-title { padding: 5px 8px 3px; color: var(--muted-2); font-size: 10px; font-weight: 900; letter-spacing: .06em; }
  .mobile-nav-item { width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: 10px; text-align: left; background: #f7fbff; color: #526f89; font-size: 12px; font-weight: 800; }
  .mobile-nav-item.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
  .nav-hamburger { display: flex !important; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); cursor: pointer; padding: 0; }
  .nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table { min-width: 720px; }
  .chart-card, .ui-card, .card, .settings-card { max-width: 100%; }
}
@media (max-width: 768px) {
  .login-split { flex-direction: column !important; }
  .login-left { display: none !important; }
  .login-right { flex: 1 !important; padding: 32px 24px !important; justify-content: flex-start !important; padding-top: 48px !important; }
  .top-row { flex-direction: column !important; }
  .top-row > * { width: 100% !important; flex: none !important; }
  .order-form-row { flex-direction: column !important; gap: 8px !important; }
  .order-form-row input[type=text], .order-form-row .country-select, .order-form-row input[type=number], .order-form-row .btn-primary { min-width: 0 !important; width: 100% !important; max-width: none !important; flex: none !important; }
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-dashboard { padding: 22px; }
  .hero-dashboard h1 { font-size: 23px; }
}
@media (max-width: 600px) {
  body { font-size: 12px; }
  .container { padding: 0 4px !important; margin: 8px auto !important; gap: 12px !important; }
  .card, .ui-card, .chart-card { padding: 12px !important; border-radius: 14px !important; }
  .card h2 { font-size: 15px !important; flex-direction: column; align-items: flex-start !important; }
  .navbar { padding: 0 16px !important; }
  .hero-dashboard { padding: 16px !important; min-height: auto; }
  .hero-dashboard h1 { font-size: 19px !important; padding-right: 40px; }
  .hero-rocket { right: 14px; top: 12px; font-size: 34px; }
  .stat-grid { grid-template-columns: 1fr; }
  .feature-tile { padding: 12px; }
  .row { gap: 8px; }
  .row input, .row select, .row button, .btn-primary, .btn-small, .btn-download { min-height: 38px; }
  .country-item { grid-template-columns: 42px 1fr; }
  .country-name-en { display: none; }
  .admin-mobile-nav { grid-template-columns: 1fr !important; }
}
@media (max-width: 540px) { .settings-page { padding: 16px !important; } .settings-card { width: 100% !important; } .auth-box { width: 100% !important; padding: 24px !important; } }
@media (max-width: 480px) { .country-dropdown { max-height: 200px !important; } .country-selected { min-width: 0 !important; width: 100%; } }
