:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1b1e24;
  --text-2: #59606d;
  --text-3: #8b93a1;
  --border: #e5e8ee;
  --accent: #3b6fe0;
  --accent-soft: #edf3fd;
  --red: #cf4444;
  --red-soft: #fdf0f0;
  --amber: #a8690c;
  --amber-soft: #fdf5e5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* {
  box-sizing: border-box;
}

/*
 * hidden 属性必须压过 .form { display: flex } 这类作者样式。
 * 浏览器的 [hidden] 默认规则优先级最低，凡是用 display 设过布局的元素
 * 都会把 hidden 顶掉 —— 结果就是"分步表单的第二步一直显示"。
 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.app-header__bar {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  color: var(--text-2);
  cursor: pointer;
  line-height: 1;
}

.icon-btn.is-spinning {
  animation: spin 0.8s linear infinite;
}

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

.filter-bar {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.notice-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.notice--pinned {
  border-left: 3px solid var(--accent);
}

/* 紧要程度优先于"置顶"的左侧色条（同为单类选择器，写在后面即可覆盖） */
.notice--urgent {
  border-left: 4px solid var(--red);
}

.notice--important {
  border-left: 4px solid var(--amber);
}

.notice--done .notice__title {
  text-decoration: line-through;
  color: var(--text-3);
}

.notice--hidden {
  opacity: 0.55;
}

.notice__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notice__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.notice__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 6px;
}

.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0f2f5;
  color: var(--text-2);
}

.badge--over {
  background: var(--red-soft);
  color: var(--red);
}

.badge--urgent {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
}

.badge--important {
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 600;
}

.badge--soon {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge--pin {
  background: var(--accent-soft);
  color: var(--accent);
}

.notice__body {
  margin: 4px 0 10px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.notice__actions {
  display: flex;
  gap: 8px;
}

.btn {
  border-radius: 8px;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}

.btn--ghost:hover {
  background: #f3f4f6;
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
  padding: 10px 18px;
  font-size: 14px;
  width: 100%;
}

.btn--primary:hover {
  background: #3560c8;
}

.btn--danger-ghost {
  background: transparent;
  border-color: #f0c9c9;
  color: var(--red);
  white-space: nowrap;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty__title {
  font-size: 15px;
  color: var(--text-2);
  margin: 0 0 4px;
}

.empty__hint {
  font-size: 13px;
  margin: 0;
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats {
  font-size: 12px;
  color: var(--text-3);
}

.footer-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.footer-link--btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  color: var(--text-3);
  cursor: pointer;
}

.footer-link--btn:hover {
  color: var(--red);
}

.admin-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-tip {
  font-size: 12px;
  color: var(--text-2);
  background: var(--accent-soft);
  border: 1px solid #d8e5fa;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 0;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.field__label {
  font-weight: 500;
}

.field__hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* 紧要程度：三段式选择器 */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: #f1f3f7;
  border-radius: 9px;
}

.segmented__item {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.segmented__item.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.segmented__item--urgent.is-active {
  background: var(--red);
  color: #ffffff;
}

.segmented__item--important.is-active {
  background: var(--amber);
  color: #ffffff;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select,
.field input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* min-width:0 是必须的：输入框有"最小内容宽度"，不给它让步就会把整行撑出卡片 */
.field-row .field {
  flex: 1 1 140px;
  min-width: 0;
}

.field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.manage__title {
  font-size: 15px;
  margin: 0 0 4px;
}

.manage__count {
  color: var(--text-3);
  font-weight: 400;
  font-size: 13px;
  margin-left: 6px;
}

.manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.manage-item:first-child {
  border-top: none;
}

.manage-item__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.manage-item__title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-item__sub {
  font-size: 12px;
  color: var(--text-3);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  background: #1b1e24;
  color: #ffffff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 20;
}

.toast--error {
  background: var(--red);
}

.offline-banner {
  max-width: 688px;
  width: calc(100% - 32px);
  margin: 12px auto 0;
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #f0e0bd;
  border-radius: 8px;
}

.form__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form__title {
  font-size: 15px;
  margin: 0;
}

.paste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafbfc;
}

.paste .btn {
  align-self: flex-start;
}

.btn--sm {
  font-size: 12px;
  padding: 5px 10px;
}

.manage-item__info {
  flex: 1;
}

.manage-item__ops {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- 通知提醒 / 推送 ---------- */

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 已开启提醒：铃铛点亮 */
.icon-btn.is-on {
  color: var(--accent);
  border-color: #c6d8fa;
  background: var(--accent-soft);
}

.hint-banner {
  max-width: 688px;
  width: calc(100% - 32px);
  margin: 12px auto 0;
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #cfe0fb;
  border-radius: 8px;
}

/* 从通知栏点进来的那条，闪一下高亮 */
.notice--focus {
  animation: notice-focus 1.8s ease-out;
}

@keyframes notice-focus {
  0%,
  40% {
    box-shadow: 0 0 0 3px rgba(59, 111, 224, 0.28);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

.push-panel {
  padding-bottom: 14px;
}

.push-status {
  font-size: 13px;
  color: var(--text-2);
  margin: 2px 0 6px;
}

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

.progress {
  height: 4px;
  margin-top: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- 账号（同学登录/身份）---------- */

.account {
  position: relative;
}

.account__login {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  text-decoration: none;
}

.account__me {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.account__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account__name {
  font-size: 13px;
  color: var(--text-2);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  padding: 6px;
  z-index: 30;
}

.account-menu__email {
  margin: 0;
  padding: 6px 10px 8px;
  font-size: 11px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}

.account-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}

.account-menu__item:hover {
  background: #f3f4f6;
}

.account-menu__item--danger {
  color: var(--red);
}

/* ---------- 单条通知的完成进度 ---------- */

/* 进度与按钮同一行：进度占满剩余宽度，按钮始终靠右 */
.notice__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.notice__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  flex: 1 1 130px;
  min-width: 130px;
  font-size: 12px;
  color: var(--text-3);
}

.notice__actions {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.notice__progress-bar {
  flex: 1;
  max-width: 120px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.notice__progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.notice--done .notice__progress-fill {
  background: #57a773;
}

/* 已完成的按钮别再用普通灰，和"未完成"一眼能分开 */
.btn--done {
  background: #eef7f1;
  border-color: #cfe8da;
  color: #2f7d52;
}

/* ---------- 班委端：完成明细 ---------- */

/* 明细要占满一整行，所以让列表项允许换行 */
.manage-item {
  flex-wrap: wrap;
}

.manage-detail {
  flex-basis: 100%;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-2);
}

.detail-group + .detail-group {
  margin-top: 10px;
}

.detail-group__title {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-3);
}

.detail-group__none {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}

.name-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-chip {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef7f1;
  color: #2f7d52;
  border: 1px solid #cfe8da;
}

.name-chip--pending {
  background: #f5f6f8;
  color: var(--text-3);
  border-color: var(--border);
}

/* ---------- 班委端：发信设置 ---------- */

.mail-panel .field {
  margin-bottom: 10px;
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

/*
 * .btn--primary 默认 width:100%（那是给表单提交按钮用的），
 * 在这一排行内按钮里会把"保存"撑成整行、把其余按钮挤到下一行。
 */
.mail-actions .btn,
.manage-item__ops .btn {
  width: auto;
}

.mail-status {
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--surface-2, #f5f6f8);
  color: var(--text-2);
  border: 1px solid var(--border);
  word-break: break-word;
}

.mail-status--ok {
  background: #eef7f1;
  border-color: #cfe8da;
  color: #2f7d52;
}

.mail-status--warn {
  background: #fdf6e7;
  border-color: #f0e0b8;
  color: #8a6414;
}

.mail-status--error {
  background: #fdeeee;
  border-color: #f3cccc;
  color: #a83232;
}
