/* ============================================================
   黑白亮色主题
   布局沿用 QQ「快捷登录 / 授权」双栏结构，颜色只用黑 / 白 / 灰
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --ink-2: #333333;
  --ink-3: #999999;
  --line: #eeeeee;
  --line-2: #e5e5e5;
  --gray-bg: #fafafa;
  --gray-check: #e6e6e6;
}

* { box-sizing: border-box; }

/* 作者样式里的 display 会盖掉浏览器默认的 [hidden]{display:none}，
   所以凡是设过 display 的元素，加 hidden 属性都不生效。这里统一兜住。 */
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ 顶部品牌条 ============ */

.site-head {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .04em;
}

/* ============ 双栏主体 ============ */

.panel {
  display: flex;
  align-items: flex-start;
  padding: 56px 0 30px;
}

/* ---------- 左列：扫码 ---------- */

.col-l {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding-right: 48px;
}

.col-l h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
}

.lead {
  margin: 0 0 30px;
  font-size: 14px;
  color: var(--ink-2);
}

.qr {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  background: #fff;
}

.qr img {
  width: 100%;
  height: 100%;
  display: block;
}

/* 同意授权前的占位 */
.qr-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-bg);
  border: 1px dashed var(--line-2);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.9;
  padding: 0 22px;
}

.qr-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .94);
}

.tick {
  font-size: 42px;
  line-height: 1;
  color: var(--ink);
  font-weight: 700;
}

/* 扫码中的扫描线 */
.qr.live::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #000 40%, #666 60%, transparent);
  opacity: .7;
  animation: scan 2.4s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { top: 4px; }
  50% { top: calc(100% - 6px); }
}

.spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status {
  margin: 18px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
}

.hint b { color: #666; font-variant-numeric: tabular-nums; }

.failbox { margin-top: 16px; }

.fail-text {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.linklike {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.linklike:hover { color: var(--ink-3); }

/* 左列底部文字链 */
.bottom-links {
  margin-top: 90px;
  display: flex;
  justify-content: center;
  gap: 70px;
}

.bottom-links a {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}

.bottom-links a:hover { text-decoration: underline; }

/* ---------- 右列：授权 ---------- */

.col-r {
  width: 350px;
  flex: none;
  border-left: 1px solid var(--line);
  padding-left: 42px;
}

.consent { animation: rise .3s ease both; }

.perm-head {
  margin: 2px 0 16px;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.cbx {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l3.8 3.8L18 8'/%3E%3C/svg%3E") center / 9px no-repeat;
  display: inline-block;
  flex: none;
}

.app-name { font-weight: 700; }

.perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.perm-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--ink-2);
}

.perm-list li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gray-check) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l3.8 3.8L18 8'/%3E%3C/svg%3E") center / 8px no-repeat;
  position: relative;
  top: 1px;
}

.perm-label { color: var(--ink-2); }

.perm-note {
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- 按钮（纯黑） ---------- */

.btn {
  width: 100%;
  margin-top: 24px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .06em;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}

.btn:hover { background: #333333; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }

.deny-link { display: block; margin: 12px auto 0; text-align: center; }

/* ---------- 完成授权 ---------- */

.done { animation: rise .3s ease both; }

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--gray-bg);
  margin-bottom: 16px;
}

.avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.who-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.who-text strong { font-size: 16px; font-weight: 600; }
.who-text span { font-size: 12px; color: var(--ink-3); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}

.done .status {
  justify-content: flex-start;
  font-weight: 400;
  color: var(--ink-2);
  font-size: 13px;
}

/* ============ 失败 / 非法入口 ============ */

.invalid {
  padding: 90px 0 60px;
  text-align: center;
}

.invalid h1 { font-size: 22px; font-weight: 600; margin: 0 0 10px; }

.cross {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--gray-bg);
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
}

.sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-3);
}

/* ============ 页脚 ============ */

.foot {
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: #bbbbbb;
  padding: 20px 0 44px;
}

/* ============ 动效 ============ */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .qr.live::after, .spin { animation: none; }
}

/* ============ 窄屏：双栏变单栏 ============ */

@media (max-width: 760px) {
  .panel { flex-direction: column; padding: 36px 0 20px; }
  .col-l { padding-right: 0; }
  .bottom-links { margin-top: 48px; gap: 36px; }
  .col-r {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 26px;
    margin-top: 30px;
  }
}
