/* Copilotrade 用户认证 / 中心 共享样式 */
* { box-sizing: border-box; }
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ============ 登录 / 注册 卡片 ============ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  padding: 20px;
}
.auth-card {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
}
.auth-card-wide { max-width: 500px; }
.auth-back {
  position: absolute; top: 16px; left: 20px;
  font-size: 13px; color: var(--text-muted); text-decoration: none;
}
.auth-back:hover { color: var(--primary); }
.auth-brand {
  text-align: center; margin-bottom: 24px;
}
.brand-logo {
  width: 56px; height: 56px; line-height: 56px; text-align: center;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; font-weight: bold; font-size: 22px;
  border-radius: 14px; margin: 0 auto 10px;
}
.brand-name { font-size: 22px; font-weight: 700; color: var(--text); }
.brand-tag  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.auth-title { text-align: center; margin: 0 0 4px; font-size: 20px; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin: 0 0 24px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text); }
.auth-form label span { font-weight: 500; }
.auth-form label em.req { color: var(--danger); font-style: normal; margin-left: 2px; }
.auth-form input {
  height: 42px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; outline: none; transition: all .15s;
  background: #fff;
}
.auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.auth-msg { font-size: 13px; min-height: 20px; }
.auth-msg.err { color: var(--danger); }
.auth-msg.ok  { color: var(--success); }

.auth-btn {
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; border: 0; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  margin-top: 6px;
  transition: transform .1s, box-shadow .15s;
}
.auth-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79,70,229,.35); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-footer {
  margin-top: 22px; text-align: center; font-size: 13px; color: var(--text-muted);
}
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer .dot { margin: 0 8px; color: var(--border); }

.auth-tips {
  margin: 20px 0 0; padding: 14px 16px 14px 32px;
  background: var(--primary-soft); border-radius: 10px;
  font-size: 12.5px; color: #4338ca; line-height: 1.7;
}
.auth-tips strong { color: #312e81; }
.auth-tips a { color: var(--primary); }

/* ============ 用户中心 dashboard ============ */
.dash-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg);
}
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 12px 24px; position: sticky; top: 0; z-index: 20;
}
.dash-header .logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--text); text-decoration: none;
}
.dash-header .logo-img {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; line-height: 32px; text-align: center; font-size: 13px;
}
.dash-header .nav-links {
  display: flex; gap: 18px; align-items: center;
}
.dash-header .nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 14px;
}
.dash-header .nav-links a:hover { color: var(--primary); }
.dash-header .user-pop {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.dash-header .user-name {
  font-weight: 600; color: var(--text);
}
.dash-header .logout-btn {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text);
}
.dash-header .logout-btn:hover { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }

.dash-main {
  max-width: 1100px; width: 100%; margin: 0 auto;
  padding: 28px 24px 60px;
}

.dash-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.dash-stat {
  background: #fff; border-radius: 12px; padding: 18px 20px;
  border: 1px solid var(--border);
}
.dash-stat .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.dash-stat .value { font-size: 24px; font-weight: 700; color: var(--text); }
.dash-stat .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.dash-stat.ok    .value { color: var(--success); }
.dash-stat.warn  .value { color: var(--warn); }
.dash-stat.danger .value { color: var(--danger); }

.dash-section {
  background: #fff; border-radius: 12px; padding: 24px;
  border: 1px solid var(--border); margin-bottom: 18px;
}
.dash-section .sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.dash-section h2 { margin: 0; font-size: 16px; }
.dash-section .sec-desc { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

.btn {
  background: var(--primary); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn:hover:not(:disabled) { background: var(--primary-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--text-muted); }
.btn.danger { background: var(--danger); }
.btn.danger:hover:not(:disabled) { background: #b91c1c; }
.btn.small { padding: 5px 10px; font-size: 12px; }

.bind-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.bind-table th, .bind-table td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border);
}
.bind-table th { color: var(--text-muted); font-weight: 500; background: var(--bg); }
.bind-table tr:last-child td { border-bottom: 0; }
.bind-table .actions { display: flex; gap: 6px; }

.empty-state {
  text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 14px;
}
.empty-state .ic { font-size: 36px; margin-bottom: 10px; }

/* 模态框 */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; padding: 26px;
  width: 100%; max-width: 420px;
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal .desc { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin-bottom: 12px; }
.modal input, .modal select {
  height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none;
}
.modal input:focus, .modal select:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-msg { font-size: 13px; min-height: 18px; }
.modal-msg.err { color: var(--danger); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.badge.online  { background: #dcfce7; color: #166534; }
.badge.offline { background: #f1f5f9; color: #64748b; }
.badge.disabled{ background: #fef3c7; color: #92400e; }
.badge.expired { background: #fee2e2; color: #991b1b; }
.badge.trial   { background: #fef9c3; color: #854d0e; }
.badge.vip     { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }

@media (max-width: 720px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-header { padding: 12px 16px; }
  .dash-header .nav-links { display: none; }
  .dash-main { padding: 20px 14px 40px; }
  .dash-section { padding: 18px; }
  .bind-table { font-size: 12px; }
  .bind-table th:nth-child(3), .bind-table td:nth-child(3) { display: none; } /* 隐藏服务器列 */
}
