/* 可梵账号中心 - 全站样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #4f6ef2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: #1e293b; }
.brand:hover { text-decoration: none; }
.topbar-links { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.topbar-links .uname { color: #475569; }

/* 主区 */
.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 16px; flex: 1; }

/* 登录/注册卡片 */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 32px;
  max-width: 420px;
  margin: 0 auto;
}
.card h1 { font-size: 20px; margin-bottom: 4px; }
.card .sub { font-size: 13px; color: #64748b; margin-bottom: 20px; }

/* 面板（个人中心） */
.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.panel-head h2 { font-size: 15px; }
.dim-tip { font-size: 12px; color: #94a3b8; }
/* 面板头自适应：提示占中间可换行，按钮贴右；窗口变窄自动换行不变形 */
.panel-head { flex-wrap: wrap; }
.panel-head .dim-tip { flex: 1 1 220px; }
.panel-head .btn { margin-left: auto; }
@media (max-width: 640px) {
  .panel-head .btn { margin-left: 0; }
}

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; }
.field .dim { font-style: normal; color: #94a3b8; font-size: 12px; }
.field input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.field input:focus { border-color: #4f6ef2; box-shadow: 0 0 0 2px rgba(79,110,242,.15); }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 38px; border-radius: 6px; cursor: pointer; border: 1px solid #e2e8f0; }

/* 按钮 */
.btn {
  display: inline-block;
  height: 36px;
  line-height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: #4f6ef2; color: #fff; }
.btn.primary:hover { background: #3f5be0; }
.btn.primary:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost { background: #fff; color: #475569; border-color: #cbd5e1; }
.btn.ghost:hover { color: #4f6ef2; border-color: #4f6ef2; }
.btn.block { width: 100%; }
.btn.sm { height: 28px; line-height: 28px; padding: 0 10px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* 消息 */
.msg { min-height: 18px; font-size: 13px; margin-top: 10px; }
.msg.ok { color: #16a34a; }
.msg.err { color: #dc2626; }

/* 卡片底部链接 */
.card-links { margin-top: 14px; font-size: 13px; text-align: center; color: #94a3b8; }
.card-links .sep { margin: 0 8px; }

/* 个人中心 */
.profile-top { display: flex; gap: 20px; align-items: flex-start; }
.avatar-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-box img {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}
.avatar-btn { cursor: pointer; }
.profile-base { flex: 1; }
.line { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; flex-wrap: wrap; }
.line .k { width: 70px; color: #64748b; font-size: 13px; flex-shrink: 0; }
.line .v { color: #1e293b; }
.dim-note { font-size: 12px; color: #94a3b8; }
.pwd-form { max-width: 360px; }
.pwd-form .btn { margin-top: 4px; }
.pwd-form .dim-tip { margin-left: 10px; }

/* 登录记录 */
.log-list { font-size: 13px; }
.log-item { display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px dashed #f1f5f9; flex-wrap: wrap; }
.log-item:last-child { border-bottom: none; }
.log-item .t { color: #475569; width: 130px; flex-shrink: 0; }
.log-item .via { color: #4f6ef2; width: 70px; flex-shrink: 0; }
.log-item .ip { color: #64748b; width: 110px; flex-shrink: 0; }
.log-item .ua { color: #94a3b8; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
/* hidden 属性优先级低于类选择器的 display:flex，需显式关闭，否则弹窗常显无法隐藏 */
.modal-mask[hidden] {
  display: none;
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 20px 24px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 15px; }
.modal-close { font-size: 20px; color: #94a3b8; text-decoration: none; line-height: 1; }

/* 协议弹窗正文（可滚动，避免长文撑破弹窗） */
.agree-body { max-height: 46vh; overflow-y: auto; font-size: 13px; line-height: 1.75; color: #475569; margin-bottom: 14px; }
.agree-body p { margin-bottom: 10px; }
.agree-body b { color: #1e293b; }

/* 注册协议勾选行 */
.agree-row {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 13px; color: #64748b; margin: 4px 0 14px; cursor: pointer;
}
.agree-row input { margin: 2px 0 0; flex: none; }
.agree-row a { color: #4f6ef2; text-decoration: none; }

/* 登录/注册页返回按钮 */
.ac-back {
  display: inline-block; margin-bottom: 10px;
  font-size: 13px; color: #64748b; text-decoration: none;
}
.ac-back:hover { color: #4f6ef2; }

/* 页脚 */
.page-footer {
  text-align: center;
  padding: 18px 12px;
  font-size: 12px;
  color: #94a3b8;
}
.page-footer a { color: #94a3b8; margin: 0 2px; }
.ac-ft-ver { margin-left: 10px; }

/* textarea（应用申请表单） */
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}
.field textarea:focus { border-color: #4f6ef2; box-shadow: 0 0 0 2px rgba(79,110,242,.15); }

/* ================= 开放平台 ================= */
/* 状态徽章：0待审核 1已启用 2已拒绝 3已停用 */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.badge.s0 { background: #fef3c7; color: #92400e; }
.badge.s1 { background: #dcfce7; color: #166534; }
.badge.s2 { background: #fee2e2; color: #991b1b; }
.badge.s3 { background: #e2e8f0; color: #475569; }

/* 应用/授权条目 */
.app-item { padding: 10px 0; border-bottom: 1px dashed #f1f5f9; }
.app-item:last-child { border-bottom: none; }
.app-item .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.app-item .meta { font-size: 12px; color: #94a3b8; margin-top: 4px; word-break: break-all; }
.app-item .app-actions { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 密钥展示框（仅显示一次） */
.secret-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  font-family: Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  margin-top: 10px;
  user-select: all;
}

/* OAuth 授权页 */
.oauth-card { max-width: 420px; }
.oauth-err-icon {
  width: 48px; height: 48px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 26px;
  font-weight: 700;
  line-height: 48px;
  text-align: center;
}
.oauth-banner {
  display: flex; align-items: center; gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}
.oauth-logo {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  flex-shrink: 0;
}
.oauth-logo.txt {
  display: inline-block;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #4f6ef2;
  line-height: 42px;
}
.oauth-logo.sm { width: 28px; height: 28px; border-radius: 6px; }
.oauth-app-line { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.oauth-app-name { font-size: 16px; font-weight: 600; }
.oauth-ask { font-size: 14px; margin-bottom: 8px; }
.oauth-scope { list-style: none; margin: 0 0 12px; }
.oauth-scope li { padding: 7px 0; font-size: 14px; border-bottom: 1px dashed #f1f5f9; }
.oauth-scope li::before { content: '✓'; color: #16a34a; margin-right: 8px; font-weight: 600; }
.oauth-remember { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; margin: 6px 0 14px; cursor: pointer; }
.oauth-remember input { width: auto; }

@media (max-width: 480px) {
  .card { padding: 22px 18px; }
  .profile-top { flex-direction: column; }
}

/* 快捷入口横排 */
.shortcut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shortcut-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color .15s;
}
.shortcut-item:hover { text-decoration: none; border-color: #4f6ef2; }
.shortcut-item .sc-title { font-size: 14px; font-weight: 600; color: #1e293b; }
.shortcut-item .sc-desc { font-size: 12px; color: #94a3b8; }
@media (max-width: 480px) { .shortcut-grid { grid-template-columns: 1fr; } }

/* 账号信息行：值占满中间，按钮统一右对齐成一列 */
.profile-base .line .v { flex: 1; }
.profile-base .line .btn { margin-left: 0; }
