/* style.css - 全局样式（One UI 风格） */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:        #0d0d0d;
  --bg-card:   #1a1a1a;
  --bg-input:  #262626;
  --accent:    #4f8ef7;
  --text:      #ffffff;
  --text-muted:#888888;
  --radius:    24px;
  --radius-sm: 14px;
}

html, body {
  height: 100%;
  background: #1a1a2e;
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--text);
}

/* 手机框容器（电脑端居中显示） */
.phone-frame {
  width: 100%;
  max-width: 450px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* 页面内边距 */
.page-content {
  padding: 0 16px;
}

/* ── 卡片 ───────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

/* ── 按钮 ───────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:active { opacity: 0.75; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
}
.btn-danger {
  background: #ff3b30;
  color: #fff;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 输入框 ─────────────────────────── */
.input-group {
  margin-bottom: 14px;
}
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.input-field {
  width: 100%;
  height: 52px;
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 16px;
  color: var(--text);
  outline: none;
}
.input-field:focus {
  box-shadow: 0 0 0 2px var(--accent);
}
.input-field::placeholder {
  color: var(--text-muted);
}

/* 验证码行（输入框+按钮横排） */
.code-row {
  display: flex;
  gap: 10px;
}
.code-row .input-field {
  flex: 1;
}
.btn-send-code {
  flex-shrink: 0;
  width: 110px;
  height: 52px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-send-code:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── 顶部导航 ───────────────────────── */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.top-nav-title {
  font-size: 18px;
  font-weight: 700;
}
.top-nav-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 18px;
}

/* ── 工具卡片 ───────────────────────── */
.tool-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
  color: var(--text);
}
.tool-card:active {
  transform: scale(0.97);
  opacity: 0.85;
}
.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-right: 16px;
  flex-shrink: 0;
}
.tool-card-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tool-card-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── 底部栏 ─────────────────────────── */
.bottom-bar {
  padding: 20px 16px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid #222;
  margin-top: 20px;
}
.bottom-bar a {
  color: var(--accent);
  text-decoration: none;
}

/* ── 标签切换（登录/注册） ──────────── */
.tab-row {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--text);
}

/* ── 徽章（剩余次数） ───────────────── */
.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
}

/* ── 分类导航栏 ─────────────────────── */
.cat-nav {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px 16px;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 18px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-btn.active {
  background: var(--accent);
  color: #fff;
}