/* ================= 苹果官网风格 ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #f5f5f7;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 680px;
  height: 100vh; /* 锁定为一屏高度，页面永不出现滚动条 */
  display: flex;
  flex-direction: column;
  padding: 32px 24px 20px;
}

/* ---------- 标题区 ---------- */
header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1d1d1f;
}

.subtitle {
  margin-top: 10px;
  font-size: 15px;
  color: #86868b;
  letter-spacing: 0.2px;
}

/* ---------- 卡片 ---------- */
.card {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1d1d1f;
  letter-spacing: -0.2px;
}

.tip {
  font-size: 14px;
  color: #86868b;
  margin: 12px 0;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* ---------- 输入框 ---------- */
.input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 16px;
  color: #1d1d1f;
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder {
  color: #a1a1a6;
}

.input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

/* ---------- 按钮（胶囊形） ---------- */
.btn {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s, opacity 0.2s;
  letter-spacing: 0.2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  background: #0071e3;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #0077ed;
}

.btn-outline {
  width: 100%;
  background: transparent;
  color: #0071e3;
  border: 1px solid #d2d2d7;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(0, 113, 227, 0.06);
  border-color: #0071e3;
}

.btn-ghost {
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 400;
  background: transparent;
  color: #0071e3;
  border: none;
  border-radius: 999px;
}

.btn-ghost:hover {
  background: rgba(0, 113, 227, 0.08);
}

.error-msg {
  margin-top: 14px;
  font-size: 14px;
  color: #d70015;
  text-align: center;
}

/* ---------- 登录 Tab（分段控件风格） ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 26px;
  background: #f5f5f7;
  border-radius: 999px;
}

.tab {
  flex: 1;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: #86868b;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.tab.active {
  background: #ffffff;
  color: #1d1d1f;
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

/* ---------- 登录面板 ---------- */
.panel {
  text-align: center;
}

.qrcode-box {
  display: inline-block;
  background: #ffffff;
  padding: 14px;
  border-radius: 16px;
  margin-top: 8px;
  border: 1px solid #e8e8ed;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.qrcode-box canvas {
  display: block;
}

#panel-qr .btn-outline {
  margin-top: 16px;
  width: auto;
  min-width: 150px;
}

/* ---------- 主界面（弹性布局：日志区自动填满剩余高度） ---------- */
#screen-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* 允许被压缩，日志区才能内部滚动而非撑高页面 */
}

.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.welcome {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.2px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* ---------- 日志控制台（严格限制在剩余空间内滚动） ---------- */
.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #1d1d1f;
  border-radius: 16px;
  padding: 16px 18px;
  font-family: "SF Mono", Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
}

.log p {
  word-break: break-all;
  white-space: pre-wrap;
}

.log .time {
  color: #6e6e73;
  margin-right: 6px;
}

.log-info { color: #c7c7cc; }
.log-success { color: #30d158; }
.log-warn { color: #ffd60a; }
.log-error { color: #ff453a; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: auto; /* 内容不满一屏时贴底显示 */
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #a1a1a6;
}

.footer p {
  margin: 4px 0;
}

/* ---------- 滚动条 ---------- */
.log::-webkit-scrollbar {
  width: 6px;
}

.log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
