:root {
  --bg: #0b1120;
  --panel: #111827;
  --card: #162033;
  --border: #24324a;
  --text: #e5edf7;
  --muted: #8ea0b8;
  --primary: #10b981;
  --primary-hover: #059669;
  --accent: #38bdf8;
  --warn: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #04131c; font-size: 16px;
}
.brand-title { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  text-align: left; background: transparent; border: 1px solid transparent;
  color: var(--muted); padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; transition: all 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7; font-weight: 600;
}

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; font-size: 12px; color: var(--muted); }
.status-pill { display: flex; align-items: center; gap: 8px; color: #6ee7b7; margin-bottom: 6px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary); }
code { background: #0f172a; padding: 2px 5px; border-radius: 4px; color: var(--accent); font-size: 11px; }

.main { flex: 1; padding: 28px 32px; overflow-y: auto; }
.panel { display: none; }
.panel.active { display: block; }
.panel-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px; gap: 16px;
}
.panel-header h1 { font-size: 22px; margin-bottom: 4px; }
.panel-header p { color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; color: #f1f5f9; }

.form-row { margin-bottom: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; background: #0f172a; border: 1px solid var(--border);
  color: var(--text); padding: 9px 11px; border-radius: 8px; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

.phone-presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.phone-presets input { flex: 1; min-width: 180px; }
.btn-chip {
  background: #1e293b; border: 1px solid var(--border); color: var(--text);
  padding: 6px 9px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-chip:hover { border-color: var(--accent); }
.country-badge {
  margin-top: 8px; font-size: 12px; color: var(--accent);
  background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 10px; border-radius: 6px; display: none;
}

.btn-primary {
  background: var(--primary); color: #04131c; border: none;
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary {
  background: #1e293b; color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15); color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-sm {
  background: #1e293b; color: var(--text); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; margin-right: 4px;
}

.result-box {
  background: #0f172a; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; min-height: 260px;
}
.empty-tip { color: var(--muted); font-size: 13px; text-align: center; padding-top: 90px; }
.translated-output {
  font-size: 16px; color: #38bdf8; font-weight: 500;
  background: rgba(56, 189, 248, 0.08); border-left: 3px solid var(--accent);
  padding: 12px 14px; border-radius: 6px; margin-bottom: 14px;
}
.meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12px; }
.meta-item { background: #162033; padding: 8px 10px; border-radius: 6px; }
.meta-item span { display: block; color: var(--muted); margin-bottom: 2px; }
.tag {
  display: inline-block; padding: 2px 7px; border-radius: 99px; font-size: 11px;
  background: rgba(16, 185, 129, 0.15); color: #6ee7b7; margin-right: 4px;
}
.tag.warn { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.tag.blue { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }

.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; background: #111827; font-size: 12px; }
tr:hover td { background: rgba(255,255,255,0.02); }

.providers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.provider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat-card .label { font-size: 12px; color: var(--muted); }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 4px; color: #f8fafc; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal.hidden { display: none; }
.modal-card {
  width: 560px; max-width: 92vw; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 20px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.btn-icon { background: transparent; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.toast {
  position: fixed; right: 24px; bottom: 24px; background: #0f172a;
  border: 1px solid var(--primary); color: #6ee7b7;
  padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 200;
}
.toast.hidden { display: none; }

@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .grid-2, .form-grid-3, .stats-grid { grid-template-columns: 1fr; }
}
