/* pages.css — 各页面专属样式 */

/* 通用页头：桌面同行右对齐，手机自动换行拉伸 */
.page-head {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px; margin-bottom: var(--gutter);
}
.page-head .titles { flex: 1 1 auto; min-width: 0; }
.page-head h1 { margin: 0; font-size: 18px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head .actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-left: auto;
}
@media (max-width: 767px) {
  .page-head .actions {
    width: 100%; margin-left: 0;
  }
  .page-head .actions .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
}

/* 账号页 —— 工具栏 */
.acc-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: var(--gutter);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px) saturate(120%);
}
.acc-toolbar .search {
  flex: 1 1 220px; min-width: 0; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 6px 10px;
}
.acc-toolbar .search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px; min-height: 26px;
}
.acc-toolbar .search svg { color: var(--muted); flex-shrink: 0; }
.acc-toolbar .seg {
  display: inline-flex; padding: 3px; background: rgba(0,0,0,.32);
  border: 1px solid var(--panel-border); border-radius: 999px;
}
.acc-toolbar .seg button {
  background: transparent; border: none; color: var(--muted);
  padding: 5px 14px; border-radius: 999px; cursor: pointer;
  font-size: 12px; min-height: 28px;
}
.acc-toolbar .seg button.on {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #0a0f1e; font-weight: 600;
}
.acc-toolbar .grow { flex: 1; }

/* 移动端：搜索占整行，分段在下方 */
@media (max-width: 767px) {
  .acc-toolbar { gap: 8px; }
  .acc-toolbar .search { flex: 1 1 100%; max-width: none; }
  .acc-toolbar .seg { width: 100%; justify-content: space-between; }
  .acc-toolbar .seg button { flex: 1; }
}

/* 账号页 —— 统计行 */
.acc-stats {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: var(--gutter);
}
.acc-stat {
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.acc-stat .lbl { color: var(--muted); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; }
.acc-stat .val { font-size: 22px; font-weight: 700; }
.acc-stat.accent .val {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.acc-stat.online .val { color: var(--accent); }
.acc-stat.offline .val { color: var(--muted); }

/* 账号页 —— 列表 */
.acc-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.acc-card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px 14px 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
}
.acc-card::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, rgba(140,160,240,.25), rgba(140,160,240,.05));
}
.acc-card.online::before {
  background: linear-gradient(180deg, var(--accent), rgba(93,211,158,.2));
  box-shadow: 0 0 12px rgba(93,211,158,.45);
}
.acc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124,140,255,.4);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.acc-card .top { display: flex; align-items: center; gap: 12px; }
.acc-card .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
  color: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 4px 12px rgba(0,0,0,.4);
}
.acc-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.acc-card .meta { flex: 1; min-width: 0; }
.acc-card .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-card .sub {
  color: var(--muted); font-size: 12px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc-card .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-card .actions { margin-top: auto; }
.acc-card .actions .btn { flex: 1; }

/* 账号页空态 */
.acc-empty {
  text-align: center; padding: 48px 16px;
  border: 1px dashed var(--panel-border); border-radius: var(--radius);
  background: rgba(0,0,0,.18);
}
.acc-empty .ico {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,140,255,.18), rgba(183,128,255,.12));
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.acc-empty .ico svg { width: 28px; height: 28px; }
.acc-empty .title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.acc-empty .desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

/* 上传/导入区 */
.drop {
  border: 2px dashed var(--panel-border); border-radius: var(--radius);
  padding: 22px; text-align: center; cursor: pointer;
  background: rgba(0,0,0,.18); position: relative;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.drag { border-color: var(--primary); background: rgba(124,140,255,.06); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { display: block; font-size: 14px; }
.drop span { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 在线任务 */
.cmd-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.cmd-btn {
  padding: 12px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--panel-border);
  color: var(--text); text-align: left; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.cmd-btn:hover { border-color: var(--primary); background: rgba(124,140,255,.08); }
.cmd-btn .desc { color: var(--muted); font-size: 11px; margin-top: 4px; }

.log-pane {
  background: rgba(0,0,0,.36); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 12px;
  font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px;
  max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.log-line { padding: 2px 0; }
.log-line .ts { color: var(--muted); margin-right: 8px; }
.log-line.send { color: var(--primary); }
.log-line.recv { color: var(--accent); }
.log-line.err { color: var(--err); }

/* 离线任务表 / 卡片堆叠 */
.task-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.task-card {
  padding: 14px; background: var(--panel);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
}
.task-card .name { font-weight: 600; margin-bottom: 4px; }
.task-card .row {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--muted);
  margin-top: 4px;
}
.task-card .row b { color: var(--text); font-weight: 500; }

/* 设置页 —— 主题网格 */
.theme-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.theme-card {
  position: relative;
  padding: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .15s, background .15s;
}
.theme-card:hover { transform: translateY(-2px); border-color: rgba(124,140,255,.4); }
.theme-card.on {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(124,140,255,.16), rgba(183,128,255,.08));
}
.theme-card.on::after {
  content: '✓'; position: absolute; top: 6px; right: 10px;
  color: var(--primary); font-weight: 700;
}
.theme-card .name { font-size: 13px; font-weight: 600; }
.theme-swatch { display: flex; height: 36px; border-radius: 10px; overflow: hidden; border: 1px solid var(--panel-border); }
.theme-swatch span { flex: 1; height: 100%; display: block; }

/* 二维码弹窗内的图框 */
.qr-frame {
  width: min(72vw, 240px); height: min(72vw, 240px); margin: 0 auto;
  background: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.qr-frame img { width: 100%; height: 100%; border-radius: 12px; }
.qr-frame .placeholder { color: #666; font-size: 13px; }
