/* WorkBuddy 多账号签到管家 —— 样式表
   统一使用设计变量，支持浅色/深色两套主题。 */

:root {
  --bg: #f4f6fb;
  --bg-accent: #e8eefc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #14181f;
  --text-muted: #667085;
  --primary: #2f6df6;
  --primary-hover: #2059d8;
  --primary-soft: #e8f0ff;
  --primary-fg: #ffffff;
  --success: #16a34a;
  --success-soft: #e7f7ed;
  --warning: #d97706;
  --warning-soft: #fdf3e3;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.18);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --ring: 0 0 0 3px rgba(47, 109, 246, 0.22);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0e1218;
  --bg-accent: #131a24;
  --surface: #161b23;
  --surface-2: #1c222c;
  --surface-3: #232a35;
  --border: #2a323d;
  --border-strong: #3a4451;
  --text: #e8edf5;
  --text-muted: #93a0b3;
  --primary: #5b8dff;
  --primary-hover: #7aa3ff;
  --primary-soft: #1b2740;
  --primary-fg: #08111f;
  --success: #34d399;
  --success-soft: #13301f;
  --warning: #fbbf24;
  --warning-soft: #33270f;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(91, 141, 255, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------ 启动画面 */

.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  color: var(--text-muted);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------ 登录页 */

.login-view {
  display: grid;
  /* 两列都给出上限（卡片 440 / 说明 460），配合 place-content 让这一组整体居中；
     早先用 minmax(0,1fr) 作右列，右列会吃掉全部剩余空间，内容整体被推到左边。 */
  grid-template-columns: minmax(0, 440px) minmax(0, 460px);
  /* place-content 同时管"整行/整列在容器里的位置"：只有一行隐式网格时，
     align-items 只管行内对齐，行本身仍会按默认的 align-content:start 贴顶。 */
  place-content: center;
  align-items: center;
  gap: 48px;
  min-height: 100vh;
  padding: 40px clamp(20px, 6vw, 96px);
  background:
    radial-gradient(1000px 520px at 12% -10%, var(--bg-accent), transparent 60%),
    var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-brand h1 {
  font-size: 19px;
}

.login-brand p {
  font-size: 12.5px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--primary);
}

.brand-mark svg {
  display: block;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--surface-3);
  border-radius: var(--radius);
}

.segmented-item {
  flex: 1;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.segmented-item:hover {
  color: var(--text);
}

.segmented-item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 登录页主入口的说明文字（管理密码面板首行）。 */
.form-lead {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
}

/* 备用邮箱登录面板底部的返回入口，与上方表单拉开距离。 */
.form-actions-top {
  margin-top: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

input:disabled,
select:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  min-width: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions .btn-block {
  flex: 1;
}

.form-note {
  margin-top: 16px;
  font-size: 12px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-aside {
  max-width: 460px;
}

.login-aside h2 {
  font-size: 26px;
  line-height: 1.3;
  margin-bottom: 16px;
}

.login-aside ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  /* 单列时卡片默认会被拉伸到整行宽；限宽并居中，保持与宽屏一致的观感。 */
  .login-card {
    width: 100%;
    max-width: 440px;
    justify-self: center;
  }
  .login-aside {
    display: none;
  }
}

/* ------------------------------------------------------------ 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.08s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

/* 按钮内的加载态 */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ------------------------------------------------------------ 应用框架 */

.app-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.brand-name {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tabs {
  display: flex;
  gap: 2px;
  flex: 1;
}

.tab {
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-3);
}

.tab.is-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.schedule-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.schedule-chip.is-active {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: var(--success-soft);
}

.schedule-chip.is-active .dot {
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.schedule-chip.is-error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: var(--danger-soft);
}

.schedule-chip.is-error .dot {
  background: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.avatar-lg {
  width: 72px;
  height: 72px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta > span:first-child {
  font-size: 12.5px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 10.5px;
  color: var(--text-muted);
}

.role-badge.is-admin {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 860px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .tabs {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
  }
  .schedule-chip {
    display: none;
  }
}

/* ------------------------------------------------------------ 主区域 */

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 64px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 15px;
}

.toolbar-hint {
  font-size: 12.5px;
}

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.inline-field select {
  width: auto;
  padding: 6px 9px;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px clamp(16px, 3vw, 32px) 0;
  padding: 13px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.banner-warn {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  background: var(--warning-soft);
  color: var(--text);
}

.banner div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.banner span {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ 卡片网格 */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card.is-disabled {
  opacity: 0.62;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 620;
  font-size: 15px;
  min-width: 0;
}

.card-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-cn {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag-ai {
  background: var(--surface-3);
  color: var(--text-muted);
}

.tag-owner {
  background: var(--surface-3);
  color: var(--text-muted);
  font-family: var(--mono);
  font-weight: 500;
}

.tag-ok {
  background: var(--success-soft);
  color: var(--success);
}

.tag-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 积分条 */
.credits {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.credits-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

/* 到期明细折叠开关：小号幽灵按钮 + 旋转箭头。 */
.credits-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.credits-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.credits-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.18s ease;
}

.credits-caret.is-open {
  transform: rotate(180deg);
}

.credits-detail[hidden] {
  display: none;
}

.credits-value {
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.credits-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 3px;
}

.credits-bar {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}

.credits-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.credits-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.credits-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.credits-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}

.credits-error {
  font-size: 12px;
  color: var(--danger);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* ------------------------------------------------------------ 表格 */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--surface-2);
}

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

#logs-table .empty,
#users-table .empty {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
}

/* ------------------------------------------------------------ 设置页 */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

.settings-card {
  gap: 14px;
}

.settings-card .panel-title {
  font-size: 14.5px;
}

.profile-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.profile-actions {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 12.5px;
}

.kv dt {
  color: var(--text-muted);
}

.kv dd {
  margin: 0;
  min-width: 0;
}

/* ------------------------------------------------------------ 弹窗 */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 20, 28, 0.5);
  backdrop-filter: blur(3px);
  animation: fade-in 0.16s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

.modal h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.modal .modal-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.choice:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.choice strong {
  font-size: 13.5px;
}

.choice span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.qr-box {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
}

.qr-canvas {
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #fff;
}

/* 扫码后需要在手机完成登录，步骤必须显眼且左对齐（.qr-box 是居中的）。 */
.qr-steps {
  width: 100%;
  margin: 0;
  padding-left: 20px;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

.qr-steps li::marker {
  color: var(--primary);
  font-weight: 600;
}

.qr-steps strong {
  color: var(--text);
}

/* 提示段落左对齐，避免在居中的 .qr-box 里逐行居中显得零碎。 */
.qr-hint {
  width: 100%;
  margin: 0;
  text-align: left;
}

.qr-canvas img,
.qr-canvas canvas {
  display: block;
}

/* 二维码由服务端渲染成 SVG，尺寸按矢量缩放，高分屏下不发虚。 */
.qr-image {
  width: 196px;
  height: 196px;
}

.qr-loading {
  display: grid;
  place-items: center;
  width: 196px;
  height: 196px;
}

/* 失败态不再使用白底画布，回到普通卡片背景，保证深浅色主题下的可读性。 */
.qr-canvas.is-failed {
  width: 100%;
  padding: 0;
  background: transparent;
}

.qr-failed {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 196px;
  padding: 12px;
  text-align: center;
}

.qr-failed p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-url {
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.poll-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ Toast */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  animation: toast-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

.toast.is-success {
  border-left-color: var(--success);
}

.toast.is-error {
  border-left-color: var(--danger);
}

.toast.is-warning {
  border-left-color: var(--warning);
}

.toast.is-info {
  border-left-color: var(--primary);
}

.toast p {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* ------------------------------------------------------------ 骨架屏 */

.skeleton-card {
  height: 188px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 签到规则列表（设置页）
   注意：必须显式锁定单列。曾经误加 .kv 类（grid-template-columns: auto 1fr），
   在窄卡片里把文字挤成每行一两个字。 */
.rules-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.rules-list li {
  position: relative;
  min-width: 0;
  padding-left: 19px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  overflow-wrap: break-word;
}

.rules-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
}

.rules-list li strong {
  font-weight: 600;
}

/* ------------------------------------------------------------ 密码显示切换 */

/* 包裹层的宽度由 .field（flex 纵向）决定，按钮绝对定位贴右侧。
   注意用 div 而非 span：.field > span 会给标签文字设字号，包住输入框会连带改掉输入框字号。 */
.pw-field {
  position: relative;
  min-width: 0;
}

.pw-field > input {
  padding-right: 40px;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.pw-toggle:hover,
.pw-toggle:active {
  color: var(--text);
  background: var(--primary-soft);
}

.pw-toggle:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: var(--ring);
}

.pw-toggle .pw-eye {
  display: block;
  width: 17px;
  height: 17px;
}
