/* ============================================================
 * 川陀软件用户中心 - 科技感设计系统
 * 白底 + 蓝青渐变 + 毛玻璃卡片 + 粒子动画
 * ============================================================ */

/* ===== Design Tokens ===== */
:root {
  --brand: #2563eb;
  --brand-light: #3b82f6;
  --brand-dark: #1d4ed8;
  --accent: #06b6d4;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
  --gradient-brand: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ===== Global ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
}
#app { height: 100%; }

/* ===== Tech Background Component ===== */
.tech-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.tech-bg__canvas {
  position: absolute;
  inset: 0;
}
.tech-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 75%);
}
.tech-bg__glow {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.06) 0%, rgba(6, 182, 212, 0.03) 45%, transparent 70%);
}
.tech-bg__circuit {
  position: absolute;
  opacity: 0.5;
}
.tech-bg__circuit--tl { top: 24px; left: 24px; }
.tech-bg__circuit--br { bottom: 24px; right: 24px; transform: rotate(180deg); }

/* ===== Auth Pages (Login/Register) ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 20px;
  position: relative;
}

/* ===== Brand Header ===== */
.auth-brand {
  text-align: center;
  margin-bottom: 32px;
  color: var(--text-primary);
  user-select: none;
  position: relative;
  z-index: 1;
}
.auth-brand-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gradient-brand);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}
.auth-brand h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.auth-brand .auth-brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-brand .auth-brand-sub::before,
.auth-brand .auth-brand-sub::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ===== Auth Card ===== */
.auth-card {
  width: 460px;
  padding: 40px 40px 36px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  overflow: hidden;
  animation: cardFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* 卡片顶部渐变线 */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent);
  border-radius: 2px;
}
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-card h2 {
  text-align: center;
  margin-bottom: 22px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}
.auth-card .el-button--primary {
  width: 100%;
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md) !important;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%) !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.auth-card .el-button--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}
.auth-card .el-button--primary:active {
  transform: translateY(0);
}
/* 按钮流光动画 */
.auth-card .el-button--primary::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  animation: btnShine 3.5s ease-in-out infinite;
}
@keyframes btnShine {
  0%, 75% { left: -60%; }
  100% { left: 130%; }
}
.auth-card .el-form-item {
  margin-bottom: 22px;
}
.auth-card .auth-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-card .auth-footer a {
  color: var(--brand);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.auth-card .auth-footer a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* Tabs */
.auth-card .el-tabs__header {
  margin-bottom: 22px;
}
.auth-card .el-tabs__nav-wrap::after {
  height: 1px;
  background: var(--border);
}
.auth-card .el-tabs__item {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  height: 42px;
  line-height: 42px;
}
.auth-card .el-tabs__item.is-active {
  color: var(--brand);
  font-weight: 600;
}
.auth-card .el-tabs__active-bar {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  height: 2.5px;
  border-radius: 2px;
}
.auth-card .el-tabs__item:hover {
  color: var(--brand-light);
}

/* SMS / Captcha rows */
.auth-card .sms-row {
  display: flex;
  gap: 10px;
}
.auth-card .sms-row .el-input {
  flex: 1;
}
.auth-card .captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.auth-card .captcha-img {
  height: 44px;
  width: 140px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-card .captcha-img:hover {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* Auth result */
.auth-result {
  text-align: center;
  padding: 40px 0;
}
.auth-result .el-icon {
  font-size: 64px;
  color: var(--success);
  margin-bottom: 16px;
}
.auth-result p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== Admin Layout ===== */
.admin-layout {
  height: 100vh;
  display: flex;
  background: var(--bg);
}
.admin-sidebar {
  width: 230px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.admin-sidebar .logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 1px;
}
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}
.admin-sidebar .nav-menu {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.admin-sidebar .nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 14px;
  gap: 10px;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
}
.admin-sidebar .nav-item:hover {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.04);
}
.admin-sidebar .nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  margin-right: 0;
}
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  overflow: hidden;
}
.admin-header {
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-header .page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.admin-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.iframe-page {
  height: calc(100vh - 112px);
}
.iframe-page iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f7fa;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.content-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.content-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.content-card .card-header h3 {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== User Profile Layout ===== */
.profile-layout {
  height: 100vh;
  display: flex;
  background: var(--bg);
}
.profile-sidebar {
  width: 230px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.profile-sidebar-title {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 1px;
}
.profile-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.profile-nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 14px;
  gap: 10px;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
}
.profile-nav-item:hover {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.04);
}
.profile-nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  margin-right: 0;
}
.profile-sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}
.profile-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  overflow: hidden;
}
.profile-main-header {
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.profile-main-header .page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.profile-main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.profile-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.frozen-tip {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #b45309;
  margin-bottom: 20px;
  font-size: 13px;
}

/* ===== Identity Page ===== */
.identity-info {
  padding: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}
.identity-info .info-row {
  display: flex;
  margin-bottom: 12px;
}
.identity-info .info-row .label {
  width: 100px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 13px;
}
.identity-info .info-row .value {
  flex: 1;
  word-break: break-all;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* ===== Misc ===== */
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }

/* ===== Third-party Redirect (Already Logged In) ===== */
.redirect-card {
  width: 480px;
  padding: 36px 40px;
}

/* Header */
.rc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.rc-header h2 {
  margin-bottom: 0 !important;
  font-size: 20px;
}
.rc-shield-icon {
  font-size: 26px;
}

/* Target Site Section */
.rc-site-section {
  margin-bottom: 16px;
}
.rc-site-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.rc-site-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.rc-site-domain {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  font-family: var(--font-mono);
}
.rc-site-path {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  word-break: break-all;
  font-family: var(--font-mono);
}

/* User Status Section */
.rc-user-section {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.rc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
}
.rc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: rc-pulse 2s infinite;
}
@keyframes rc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Account Info Box */
.rc-account-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.rc-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.rc-account-row + .rc-account-row {
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: 4px;
}
.rc-account-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.rc-account-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 42px;
  flex-shrink: 0;
}
.rc-account-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

/* Divider */
.rc-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 20px;
}

/* Action Section */
.rc-action-section {
  text-align: center;
}

/* Countdown - clickable */
.rc-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.rc-countdown-active {
  color: var(--brand);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.rc-countdown-active:hover {
  background: #dbeafe;
  color: var(--brand-dark);
}
.rc-countdown-paused {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.rc-countdown-paused:hover {
  background: #fef3c7;
  color: #92400e;
}
.rc-countdown-icon {
  font-size: 16px;
}

/* Buttons */
.rc-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rc-btn-go {
  width: 100%;
  height: 44px !important;
  font-size: 15px !important;
}
.rc-btn-relogin {
  width: 100%;
  height: 44px !important;
  font-size: 14px !important;
  color: var(--text-secondary) !important;
}

/* ===== Version Footer ===== */
.version-footer {
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ===== Element Plus Overrides ===== */
/* 输入框 */
.el-input__wrapper {
  border-radius: var(--radius-md) !important;
  transition: all 0.25s ease;
}
.el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1.5px var(--brand) inset, 0 0 0 4px rgba(37, 99, 235, 0.08) !important;
}
.el-textarea__inner {
  border-radius: var(--radius-md) !important;
}
.el-textarea__inner:focus {
  box-shadow: 0 0 0 1.5px var(--brand) inset, 0 0 0 4px rgba(37, 99, 235, 0.08) !important;
}

/* 按钮通用 */
.el-button--primary {
  --el-button-bg-color: var(--brand);
  --el-button-border-color: var(--brand);
  --el-button-hover-bg-color: var(--brand-light);
  --el-button-hover-border-color: var(--brand-light);
  --el-button-active-bg-color: var(--brand-dark);
  --el-button-active-border-color: var(--brand-dark);
  border-radius: var(--radius-md) !important;
}
.el-button {
  border-radius: var(--radius-md) !important;
}

/* 表格 */
.el-table {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.el-table th.el-table__cell {
  background: var(--bg-soft) !important;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
}

/* Dialog */
.el-dialog {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}
.el-dialog__header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

/* Badge */
.el-badge__content {
  background: linear-gradient(135deg, var(--brand), var(--accent)) !important;
  border: none !important;
}

/* Switch */
.el-switch.is-checked .el-switch__core {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}

/* Message */
.el-message {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .auth-card {
    width: 100%;
    padding: 28px 20px 24px;
    border-radius: 16px;
  }
  .redirect-card {
    width: 100%;
  }
  .tech-bg__circuit {
    display: none;
  }
}
