/* 尾盘选股助手 - 优化样式表 (Glass + OLED 深色) */
:root {
  --bg: #08090d;
  --surface: rgba(22, 24, 36, 0.85);
  --surface-hover: rgba(28, 30, 44, 0.9);
  --border: rgba(255,255,255,0.06);
  --border-focus: rgba(88,166,255,0.4);
  --text: #d4d8e0;
  --text-dim: #7c8391;
  --red: #f85149;
  --green: #2ea043;
  --gold: #e2a820;
  --blue: #58a6ff;
  --accent: #e6edf3;
  --glass-blur: 12px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 20px rgba(88,166,255,0.06);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  -webkit-font-smoothing: antialiased; letter-spacing: 0.01em;
}
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.container.hidden { display: none; }
/* 已登录用户刷新时消除遮罩闪烁：内联脚本在 body 渲染前设置 html.logged-in */
html.logged-in .login-overlay { display: none; visibility: hidden; }
/* container 显示由 body 末尾内联脚本在恢复 tab 后控制，避免首帧闪现默认 tab */

/* Header */
.header {
  display:flex; justify-content:space-between; align-items:flex-end;
  padding: 8px 0 18px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.header h1 {
  font-size: 20px; font-weight: 700; color: var(--accent);
  letter-spacing: -0.02em;
}
.header .sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; font-weight: 400; }
.header-right {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.header-logo {
  width: 48px; height: 48px; flex-shrink: 0;
}
.header .clock {
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
  white-space: nowrap; font-weight: 500;
}
.clock-mobile { display: none; }

/* Tabs */
.tabs {
  display:flex; gap:0; margin-bottom: 20px;
  position: relative;
}
.tabs::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.tab {
  padding: 10px 22px; font-size: 13px; font-weight: 500; color: var(--text-dim);
  cursor: pointer; border: none; background: none;
  position: relative; transition: color 0.2s, background 0.2s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  letter-spacing: 0.02em;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.tab.active {
  color: var(--blue); font-size: 14px;
}
.tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 8px; right: 8px;
  height: 2px; background: var(--blue); border-radius: 2px 2px 0 0;
}

/* Market Cards */
.market-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.idx-card {
  flex: 1; min-width: 160px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.idx-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-md);
}
.idx-card .name { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.idx-card .price { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; }
.idx-card .pct { font-size: 14px; margin-top: 4px; font-weight: 600; }
.idx-card .loading { color: var(--text-dim); font-size: 13px; }

.section { display:none; }
.section.active { display:block; }

/* Config Panel */
.config-panel {
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px; margin-bottom: 20px;
  display: flex; align-items: end; gap: 16px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.config-row { display: contents; }
.config-group { display: flex; flex-direction: column; gap: 6px; }
.config-group label {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.config-group input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); padding: 9px 14px;
  font-size: 15px; width: 140px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-variant-numeric: tabular-nums;
}
.config-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.08);
}
.config-group input::placeholder { color: var(--text-dim); opacity: 0.5; }

/* Buttons */
.btn {
  background: var(--blue); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 10px 28px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(88,166,255,0.15);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88,166,255,0.25);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.danger {
  background: var(--red);
  box-shadow: 0 2px 8px rgba(248,81,73,0.2);
}
.config-panel .btn.danger { margin-left: auto; }
.btn.danger:hover { box-shadow: 0 4px 14px rgba(248,81,73,0.3); }
.btn.small { padding: 5px 14px; font-size: 11px; font-weight: 500; }

/* Status */
.status { text-align: center; padding: 8px; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.status.error { color: var(--red); } .status.warn { color: var(--gold); }

.table-wrap.hidden-result { display: none; }

/* Result */
#marketWarn.market-warn {
  display: none;
  padding: 10px 16px; margin-bottom: 12px;
  background: #fff3cd; color: #856404;
  border: 1px solid #ffc107; border-radius: 6px;
  font-size: 13px; font-weight: 500; line-height: 1.5;
}

.result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 12px; color: var(--text-dim); font-weight: 500;
}
.result-header .count { color: var(--blue); font-weight: 600; }

/* Table */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: rgba(255,255,255,0.02); color: var(--text-dim); font-weight: 600;
  text-align: right; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em;
}
th:first-child, th:nth-child(2) { text-align: left; }
td {
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.03);
  text-align: right; white-space: nowrap;
}
td:first-child, td:nth-child(2) { text-align: left; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* 复制股票代码图标 */
.copy-code {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 4px; cursor: pointer; opacity: 0.3; transition: opacity 0.2s, color 0.2s;
  color: var(--text-dim); vertical-align: middle;
}
.copy-code:hover { opacity: 0.7; color: var(--primary); }
.copy-code.copied { opacity: 1; color: #22c55e; }

.up { color: var(--red); } .down { color: var(--green); }
.pass { color: var(--green); font-weight: 700; } .fail { color: var(--red); font-weight: 600; }

.score-badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-weight: 700; font-size: 11px; letter-spacing: 0.02em;
}
.score-high { background: rgba(46,160,67,0.15); color: var(--green); }
.score-mid { background: rgba(226,168,32,0.15); color: var(--gold); }
.score-low { background: rgba(248,81,73,0.12); color: var(--red); }

/* Spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .6s linear infinite; margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Info Box */
.info-box {
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 28px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.info-box h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--accent); }
.info-box .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.info-box .item { font-size: 13px; color: var(--text-dim); line-height: 1.7; }
.info-box .item strong { color: var(--text); font-weight: 600; }
.info-box .divider { border-top: 1px solid var(--border); margin: 18px 0; }
.info-box .note { font-size: 12px; color: var(--text-dim); margin-top: 14px; line-height: 1.7; }

/* Filter Form */
.filter-form { margin-top: 14px; }
.filter-row { margin-bottom: 12px; }
.filter-row label, .filter-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 5px; }
.filter-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.filter-inputs label { display: flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0; }
.filter-row input[type="number"] {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text); padding: 6px 12px; border-radius: var(--radius-sm);
  width: 90px; min-width: 0; flex: 1 1 auto; font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 14px; text-align: center; transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-row input[type="number"]:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.08);
}
.filter-sep { color: var(--text-dim); font-size: 14px; flex-shrink: 0; white-space: nowrap; }
.filter-unit { color: var(--text-dim); font-size: 12px; flex-shrink: 0; white-space: nowrap; }
.cfg-val { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.btn-sm { padding: 5px 14px; font-size: 11px; border-radius: var(--radius-sm); font-weight: 500; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }

/* Log Panel */
.log-panel {
  display: none;
  margin-top: 24px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.log-toggle {
  padding: 12px 18px; font-size: 13px; color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; gap: 8px; -webkit-user-select: none;
user-select: none;
  background: none; border: none; width: 100%; text-align: left;
  transition: background 0.15s; font-weight: 500;
}
.log-toggle:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.log-toggle .arrow { transition: transform .2s; font-size: 10px; display: inline-block; width: 12px; }
.log-toggle.open .arrow { transform: rotate(90deg); }
.log-content {
  display: none; padding: 0 18px 14px; max-height: 260px; overflow-y: auto;
  border-top: 1px solid var(--border);
}
.log-content.open { display: block; }
.log-line {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 11px; color: var(--text-dim); line-height: 1.9; white-space: nowrap;
  padding: 1px 0;
}
.log-line .log-num { color: var(--blue); }
.log-line .log-pass { color: var(--green); }
.log-line .log-fail { color: var(--red); }
.log-line .log-arrow { color: var(--text-dim); }
.log-line.warn { color: var(--gold); }
.log-line.error { color: var(--red); }
.log-line.info { color: var(--text-dim); }
.log-empty { font-size: 12px; color: var(--text-dim); padding: 14px 0; }

/* Log Progress Bar */
.log-progress {
  width: calc(100% - 36px); height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px; overflow: hidden;
  margin: 2px 18px 8px 18px;
}
.log-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), #3fb950);
  border-radius: 2px;
  position: relative;
  transition: width 0.4s ease;
}
.log-progress-bar::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 40%,
    rgba(255,255,255,0.15) 60%,
    transparent 100%
  );
  animation: progress-shimmer 1.5s ease-in-out infinite;
}
@keyframes progress-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.log-progress-label {
  font-size: 11px; color: var(--text-dim);
  margin-top: -4px; margin-bottom: 2px; font-weight: 500;
  padding: 0 18px;
}

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-dim); font-size: 14px; line-height: 2; }

/* Login Overlay */
.login-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 5, 8, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 200;
  display: flex; justify-content: center; align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* 默认不可见，避免锁关闭时刷新首帧闪烁。
     仅当 <head> 异步 IIFE 确认锁已开启 + 未登录时才由 JS 设置为 visible */
  visibility: hidden;
}
@media (max-width: 480px) {
  .login-overlay { align-items: flex-start; padding-top: 10vh; padding-bottom: 20vh; }
  .login-card { margin: 0 12px; padding: 40px 24px; }
}
.login-overlay.hidden { display: none; }
.login-card {
  background: rgba(22, 24, 36, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 48px 40px;
  width: 380px; max-width: 92vw;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 60px rgba(88, 166, 255, 0.04);
}
.login-icon { margin-bottom: 20px; }
.login-title {
  font-size: 22px; font-weight: 700; color: #e6edf3;
  margin-bottom: 6px; letter-spacing: -0.02em;
}
.login-sub {
  font-size: 13px; color: #7c8391; margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px; color: #d4d8e0;
  padding: 12px 16px; font-size: 15px; outline: none;
  text-align: center; letter-spacing: 0.15em;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
  border-color: rgba(88, 166, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.08);
}
.login-input::placeholder { color: #7c8391; opacity: 0.5; letter-spacing: 0.02em; }
.login-btn {
  background: #58a6ff; color: #fff; border: none;
  border-radius: 8px; padding: 12px 28px; font-size: 14px;
  font-weight: 600; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.2);
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.3);
}
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.login-error {
  font-size: 12px; color: #f85149; min-height: 18px;
  margin-top: 4px; transition: opacity 0.2s;
}


/* Modal */
.modal-overlay {
  display:none; position:fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index:100; justify-content:center; align-items:center;
}
.modal-overlay.show { display:flex; }
.modal {
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 900px; max-height: 80vh; overflow-y: auto;
  width: 95%; padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.modal .close {
  float: right; background: none; border: none; color: var(--text-dim);
  font-size: 22px; cursor: pointer; transition: color 0.2s;
  line-height: 1;
}
.modal .close:hover { color: var(--text); }

/* Data Source Indicator */
.ds-indicator {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; white-space: nowrap; font-weight: 500;
}
.ds-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0; transition: background 0.3s, box-shadow 0.3s;
}
.ds-dot.ok    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.ds-dot.warn  { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.ds-dot.err   { background: var(--red);  box-shadow: 0 0 6px var(--red); }
.ds-dot.unknown { background: #555; }
.ds-name   { color: var(--text-dim); transition: color 0.3s; }
.ds-latency { color: var(--text-dim); font-size: 10px; transition: color 0.3s; }
.ds-msg    { color: var(--red); font-size: 10px; transition: color 0.3s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .container { padding: 8px; }

  .header { flex-direction: row; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 0 12px; margin-bottom: 10px; }
  .header h1 { font-size: 17px; flex: 1 1 auto; min-width: 0; }
  .header .sub { font-size: 10px; }
  .header-right { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
  .header-right .clock { display: none; }
  .clock-mobile { display: block; }

  .tabs { gap: 0; flex-wrap: nowrap; align-items: center; overflow-x: auto; }
  .tab { padding: 8px 14px; font-size: 11px; min-height: 44px; display: flex; align-items: center; white-space: nowrap; }
  .ds-indicator { font-size: 10px; margin-left: auto; flex-shrink: 0; padding-left: 8px; }

  .market-bar { flex-direction: row; flex-wrap: nowrap; gap: 6px; margin-bottom: 12px; }
  .idx-card { flex: 1; min-width: 0; padding: 10px 10px; }
  .idx-card .price { font-size: 15px; }
  .idx-card .name { font-size: 10px; }
  .idx-card .pct { font-size: 11px; }

  .config-panel { flex-direction: column; align-items: stretch; padding: 14px 14px; gap: 10px; margin-bottom: 12px; }
  .config-row { display: flex; gap: 10px; }
  .config-row .config-group { flex: 1; min-width: 0; }
  .config-group { gap: 4px; }
  .config-group label { font-size: 10px; }
  .config-group input { width: 100%; font-size: 14px; padding: 10px 12px; min-height: 44px; }
  .btn { min-height: 44px; font-size: 13px; padding: 10px 20px; }
  .btn.small { min-height: 44px; font-size: 12px; padding: 6px 14px; }
  .config-panel .btn { width: 100%; }
  .btn-sm { min-height: 36px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
  table { font-size: 11px; }
  th { padding: 8px 8px; font-size: 10px; letter-spacing: 0.03em; }
  td { padding: 8px 8px; font-size: 11px; }
  .score-badge { font-size: 10px; padding: 2px 8px; }

  .log-panel { margin-top: 16px; }
  .log-toggle { padding: 10px 12px; font-size: 12px; min-height: 44px; }
  .log-content { max-height: 160px; padding: 0 10px 8px; }
  .log-line { font-size: 10px; line-height: 1.6; }

  .toolbar { flex-wrap: wrap; gap: 6px; }
  .toolbar .btn.small { min-height: 44px; }

  .info-box { padding: 14px 14px; margin-bottom: 12px; }
  .info-box h3 { font-size: 14px; }
  .info-box .grid { grid-template-columns: 1fr; gap: 10px; }
  .info-box .item { font-size: 12px; line-height: 1.6; }
  .info-box .note { font-size: 11px; }
  .filter-form { margin-top: 8px; }
  .filter-row { margin-bottom: 12px; }
  .filter-row label { font-size: 12px; }
  .filter-row input[type="number"] { width: 100%; min-height: 40px; font-size: 14px; }
  .filter-sep { font-size: 13px; flex-shrink: 0; white-space: nowrap; }
  .filter-unit { font-size: 12px; flex-shrink: 0; white-space: nowrap; }
  .filter-inputs { flex-wrap: nowrap; }

  button, .btn, .tab, .log-toggle { min-height: 44px; display: flex; align-items: center; justify-content: center; }

  .modal { width: 98%; max-width: none; padding: 16px; max-height: 85vh; }
  .modal h3 { font-size: 15px; }
  .modal .close { font-size: 24px; padding: 4px 8px; min-height: 44px; }

  .empty-state { padding: 36px 12px; font-size: 13px; line-height: 1.8; }
  .result-header { flex-direction: column; gap: 4px; font-size: 12px; }

  #sec-history th:nth-child(5),
  #sec-history td:nth-child(5) { display: none; }
  #sec-history td:last-child { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
  #sec-history .btn.small { min-height: 28px; font-size: 11px; padding: 2px 8px; }
}

/* --- Inline style replacements (moved from index.html) --- */
#logPanel { display: none; }
#logBadge { font-size: 11px; color: var(--text-dim); margin-left: 4px; }
#logProgressLabel { display: none; }
#logProgress { display: none; }
#histCount { font-size: 12px; color: var(--text-dim); margin-left: auto; }
th.col-cb { width: 40px; }
th.col-time { text-align: left; }
.btn-reset-filter { float: right; padding: 4px 14px; font-size: 12px; }
#cfgSaveMsg { margin-right: 12px; font-size: 13px; }
.filter-row-actions { margin-top: 12px; display: flex; justify-content: flex-end; align-items: center; }

/* 定时自动选股面板 */
.auto-pick-panel { cursor: default; }
.auto-pick-header {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none; padding: 4px 0;
}
.auto-pick-title { font-weight: 600; color: var(--accent); }
.auto-pick-body { padding-top: 4px; border-top: 1px solid var(--border); margin-top: 8px; }

/* 开关样式 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.12); transition: 0.3s; border-radius: 24px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; transition: 0.3s; border-radius: 50%;
}
input:checked + .slider { background: var(--blue); }
input:checked + .slider:before { transform: translateX(20px); }

/* ============================================================
   后台管理页面 (admin.html) 专属样式
   ============================================================ */

/* ---- 两列并排布局 ---- */
.admin-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: stretch;
}
.admin-col {
  flex: 1;
  min-width: 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-col .admin-section {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---- Admin Section 卡片容器 ---- */
.admin-section {
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-section:hover {
  border-color: rgba(255,255,255,0.1);
}

/* ---- 区块标题 ---- */
.section-title {
  font-size: 14px; font-weight: 600;
  color: var(--accent, #e6edf3);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

/* ---- 表单行 ---- */
.form-row {
  display: flex; align-items: flex-start; gap: 14px;
  flex-wrap: wrap;
}
.form-group {
  display: flex; flex-direction: column; gap: 5px;
}
.form-group label {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-group input,
.form-group select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 14px; font-size: 14px;
  outline: none; min-height: 42px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.08);
}
.form-group input::placeholder { color: var(--text-dim); opacity: 0.5; }

/* ---- 锁状态标签 ---- */
.lock-label {
  font-size: 13px; color: var(--text);
  font-weight: 500;
}
.lock-hint {
  font-size: 12px; color: var(--text-dim);
  margin: 6px 0 0; line-height: 1.6;
}

/* ---- 锁行居中 & 按钮底对齐 ---- */
.form-row:has(.lock-label) {
  align-items: center;
}
.form-row:has(.form-group) > .btn {
  align-self: flex-end;
}

/* ---- 按钮增强 ---- */
.btn.primary {
  background: linear-gradient(135deg, #3fb950, #2ea043);
  box-shadow: 0 2px 10px rgba(46,160,67,0.2);
}
.btn.primary:hover {
  box-shadow: 0 4px 16px rgba(46,160,67,0.35);
  transform: translateY(-1px);
}

/* ---- 退出登录链接 ---- */
.logout-link {
  font-size: 12px; color: var(--text-dim);
  cursor: pointer; font-weight: 500;
  padding: 4px 10px; border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.logout-link:hover {
  color: var(--red);
  background: rgba(248,81,73,0.08);
}

/* ---- 头部右侧图标 ---- */
.header-icon {
  width: 36px; height: 36px;
  filter: drop-shadow(0 0 6px rgba(229,83,75,0.25));
}

/* ---- 副标题 ---- */
.sub {
  font-size: 12px; color: var(--text-dim);
  margin-top: 2px; font-weight: 400;
}

/* ---- Toast 提示 ---- */
.toast {
  font-size: 12px; color: var(--text-dim);
  min-height: 20px; margin-top: 8px;
  padding: 6px 0; line-height: 1.5;
  transition: color 0.25s;
}
.toast.success { color: var(--green); font-weight: 500; }
.toast.error   { color: var(--red);   font-weight: 500; }

/* ---- 临时密码结果区 ---- */
.temp-result {
  display: none;
  margin-top: 14px; padding: 14px 18px;
  background: rgba(46,160,67,0.06);
  border: 1px solid rgba(46,160,67,0.15);
  border-radius: var(--radius-sm);
}
.temp-result.show { display: block; }
.temp-pwd-row {
  display: flex; align-items: center; gap: 10px;
}
.temp-pwd {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 20px; font-weight: 700; color: var(--green);
  letter-spacing: 0.08em;
}
.temp-info {
  font-size: 12px; color: var(--text-dim);
  margin-top: 8px;
}

/* ---- 复制按钮 ---- */
.copy-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer;
  font-size: 11px; font-weight: 500;
  padding: 3px 10px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.copy-btn:hover {
  color: var(--blue); border-color: rgba(88,166,255,0.3);
  background: rgba(88,166,255,0.06);
}
.copy-btn.copied {
  color: var(--green); border-color: rgba(46,160,67,0.3);
  background: rgba(46,160,67,0.06);
}

/* ---- 空列表提示 ---- */
.empty-hint {
  text-align: center; padding: 28px 20px;
  color: var(--text-dim); font-size: 13px;
}

/* ---- 登录卡片返回链接 ---- */
.login-back {
  margin-top: 18px; font-size: 12px;
}
.login-back a {
  color: var(--text-dim); text-decoration: none;
  transition: color 0.2s;
}
.login-back a:hover { color: var(--blue); }

/* ---- 后台管理页响应式 ---- */
@media (max-width: 768px) {
  .admin-col {
    min-width: 100%;
  }
  .admin-section {
    padding: 14px 14px; margin-bottom: 12px;
    border-radius: var(--radius-sm);
  }
  .section-title {
    font-size: 13px; margin-bottom: 10px; padding-bottom: 8px;
  }
  .form-row {
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .form-row:has(.lock-label) {
    flex-direction: row; align-items: center; justify-content: space-between;
  }
  .form-row:has(.lock-label) .btn {
    flex-shrink: 0;
  }
  .form-row:has(.form-group) {
    flex-direction: row; flex-wrap: nowrap;
  }
  .form-row:has(.form-group):has(.btn) {
    align-items: flex-end;
  }
  .form-row:has(.form-group):not(:has(.btn)) {
    align-items: flex-start;
  }
  .form-row:has(.form-group) > .btn {
    flex-shrink: 0; align-self: flex-end;
  }
  .form-row:has(.form-group) > .form-group {
    flex: 1 1 auto; min-width: 0;
  }
  #autoPickBody .form-row {
    flex-direction: column !important;
    align-items: stretch;
    gap: 10px;
  }
  #autoPickBody .form-group {
    width: 100%;
    flex: none;
  }
  #autoPickBody .form-group input {
    width: 100% !important;
  }
  #autoPickTime {
    min-width: 0 !important;
  }
  .form-group input,
  .form-group select {
    width: 100%; min-height: 44px; font-size: 16px;
  }
  .temp-pwd { font-size: 16px; }
  .logout-link { font-size: 13px; padding: 6px 12px; }
}
