/* ==========================================================================
   首页 · 评委投票通道
   移动端优先，重点适配微信内置浏览器（X5 / WKWebView）
   ========================================================================== */

.app {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) 18px calc(var(--safe-bottom) + 36px);
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand .mark {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 6px 14px rgba(255, 178, 62, 0.35));
}

.brand .brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand .brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand .brand-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--text-3);
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 46vw;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.user-chip:active {
  transform: scale(0.96);
}

.user-chip .avatar {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent-2));
  color: #10131f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-chip .avatar svg {
  width: 14px;
  height: 14px;
  display: block;
}

.user-chip .uname {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  transition: transform 0.15s ease, color 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  margin: 30px 0 24px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.36em;
  color: var(--gold);
  text-transform: uppercase;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.hero-eyebrow::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-title {
  margin: 12px 0 10px;
  font-size: clamp(34px, 9.4vw, 58px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.03em;
  background: linear-gradient(120deg, #fff 8%, var(--gold) 46%, #ffe6b3 74%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title {
  background: linear-gradient(120deg, #1b2450 6%, var(--gold) 48%, #b8801a 78%, #1b2450 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--text-2);
  font-size: 14.5px;
  letter-spacing: 0.04em;
}

.hero-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 公告 */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(255, 205, 107, 0.7);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.notice .ico {
  flex: none;
  margin-top: 2px;
  color: var(--gold);
}

.notice .ico svg {
  width: 15px;
  height: 15px;
}

/* 进度条 */
.myprogress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--panel-2), var(--panel));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.myprogress .ring {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
}

.myprogress .ring svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}

.myprogress .ring .track {
  stroke: var(--panel-3);
}

.myprogress .ring .bar {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.myprogress .ring .val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.myprogress .ptext {
  min-width: 0;
}

.myprogress .ptitle {
  font-size: 14px;
  font-weight: 700;
}

.myprogress .pdesc {
  color: var(--text-2);
  font-size: 12.5px;
}

.segments {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.segments i {
  display: block;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--panel-3);
}

.segments i.on {
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}

/* --------------------------------------------------------------------------
   入口卡片
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

@media (min-width: 620px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 19px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(158deg, var(--panel-2), var(--panel));
  text-align: left;
  overflow: hidden;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease,
    box-shadow 0.28s ease;
  animation: cardIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card .accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c), rgba(255, 255, 255, 0));
  opacity: 0.9;
}

.card .glow {
  position: absolute;
  z-index: -1;
  right: -34%;
  top: -46%;
  width: 68%;
  height: 118%;
  background: radial-gradient(circle at 50% 50%, var(--c-soft), transparent 68%);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.card .num {
  position: absolute;
  right: 12px;
  top: 2px;
  font-family: var(--mono);
  font-size: 62px;
  font-weight: 800;
  line-height: 1;
  color: var(--c);
  opacity: 0.13;
  letter-spacing: -0.04em;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.card:hover .glow {
  opacity: 1;
}

.card:active {
  transform: scale(0.985);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c);
  border: 1px solid var(--c-line);
  background: var(--c-soft);
}

.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c);
}

.round-tag {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-family: var(--mono);
}

.card-title {
  position: relative;
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.card-sub {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.card-cta .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 13.5px;
  font-weight: 700;
}

.card-cta .go svg {
  width: 14px;
  height: 14px;
  transition: transform 0.22s ease;
}

.card:hover .card-cta .go svg {
  transform: translateX(3px);
}

.card-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
}

.card-state.done {
  color: var(--ok);
}

.card-state.pending {
  color: var(--text-3);
}

.card-state.doing {
  color: var(--warn);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(255, 176, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); }
}

.card.is-done {
  border-color: rgba(53, 214, 142, 0.28);
}

.card.is-done .glow {
  opacity: 0.35;
}

.card.is-doing {
  border-color: rgba(255, 176, 32, 0.4);
}

.card.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* 分组标题 */
.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* 页脚 */
.footer {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.9;
}

.footer .ver {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   登录 / 改名遮罩
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 24px) 18px calc(var(--safe-bottom) + 24px);
  background: radial-gradient(circle at 50% 0%, rgba(91, 141, 255, 0.16), transparent 60%),
    rgba(5, 7, 18, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.28s ease both;
}

[data-theme="light"] .overlay {
  background: radial-gradient(circle at 50% 0%, rgba(91, 141, 255, 0.18), transparent 60%),
    rgba(233, 238, 251, 0.9);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 30px 24px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

/* 顶部金色发丝线，让卡片更精致 */
.login-card::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.75;
}

[data-theme="light"] .login-card {
  background: linear-gradient(165deg, #ffffff, #f2f5ff);
}

.login-card .halo {
  position: absolute;
  left: 50%;
  top: -40%;
  width: 90%;
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 50%, rgba(255, 205, 107, 0.22), transparent 68%);
  pointer-events: none;
}

.login-head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.login-head .mark {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 12px 26px rgba(255, 178, 62, 0.4));
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-tip {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}

.login-form {
  position: relative;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input-wrap {
  position: relative;
}

.login-input {
  width: 100%;
  padding: 15px 16px 15px 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 17px; /* ≥16px：防止 iOS 聚焦时自动放大 */
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

[data-theme="light"] .login-input {
  background: rgba(255, 255, 255, 0.9);
}

.login-input::placeholder {
  color: var(--text-3);
  letter-spacing: 0;
  font-size: 15px;
}

.login-input:focus {
  border-color: rgba(255, 205, 107, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 205, 107, 0.13);
}

.login-input-wrap .ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}

.login-input-wrap .ico svg {
  width: 18px;
  height: 18px;
}

.login-submit {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-3);
}

.login-actions .link {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
  padding: 6px 2px;
}

.login-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12.5px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   底部动作面板（从问卷星返回后询问是否已完成）
   -------------------------------------------------------------------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 6, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.22s ease both;
}

.sheet-card {
  width: 100%;
  max-width: 460px;
  padding: 22px 20px calc(20px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  background: var(--bg-2);
  box-shadow: 0 -20px 50px -24px rgba(0, 0, 0, 0.85);
  animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[data-theme="light"] .sheet-card {
  background: #fff;
}

@keyframes sheetUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-grab {
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--panel-3);
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
}

.sheet-desc {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.sheet-btn {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
}

.sheet-btn.ok {
  border: 0;
  background: linear-gradient(135deg, #35d68e, #12a86a);
  color: #04231a;
  box-shadow: 0 14px 30px -16px rgba(53, 214, 142, 0.7);
}

@media (min-width: 560px) {
  .sheet {
    align-items: center;
  }
  .sheet-card {
    border-radius: var(--radius-xl);
    border-bottom: 1px solid var(--border);
    padding-bottom: 22px;
  }
}

/* 首次进入的加载层 */
.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 0.3s ease;
}

.boot .mark {
  width: 52px;
  height: 52px;
  animation: float 2.4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.boot .txt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--text-3);
  text-transform: uppercase;
}

/* 桌面端微调 */
@media (min-width: 860px) {
  .app {
    padding-top: calc(var(--safe-top) + 34px);
  }
  .hero {
    margin-top: 44px;
  }
  .hero-sub {
    font-size: 16px;
  }
}
