* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #faf9f7;
  color: #222;
}

.screen {
  min-height: 100vh;
}

/* 欢迎页 */
#welcome-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(160deg, #24243e, #302b63, #0f0c29);
  color: #fff;
}

/* 重要：不能直接写 display:flex，因为作者样式的优先级高于浏览器对 [hidden] 的默认 display:none，
   直接设置会导致元素被 JS 设置 hidden 后仍然可见；用 :not([hidden]) 才能和 hidden 属性共存 */
#welcome-screen:not([hidden]) {
  display: flex;
}

.brand-mark {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.brand-title {
  font-size: 30px;
  letter-spacing: 4px;
  margin: 0 0 12px;
}

.brand-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 36px;
}

.signin-box {
  margin-bottom: 24px;
}

.continue-btn {
  padding: 14px 48px;
  background: #ffffff;
  color: #24243e;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  letter-spacing: 2px;
  cursor: pointer;
}

.tip {
  color: #ffb4a2;
  font-size: 13px;
  max-width: 480px;
}

.legal-links {
  margin-top: 28px;
  font-size: 12px;
}

.legal-links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

.legal-links a:hover {
  text-decoration: underline;
}

.legal-links span {
  color: rgba(255, 255, 255, 0.35);
  margin: 0 6px;
}

#life-screen .legal-links {
  text-align: center;
  margin-top: 6px;
}

#life-screen .legal-links a {
  color: #999;
}

#life-screen .legal-links span {
  color: #ccc;
  margin: 0 6px;
}

/* 人生页 */
.life {
  max-width: 600px;
  margin: 0 auto;
  padding: 18px 16px 30px;
}

.header {
  padding-bottom: 8px;
}

.universe {
  font-size: 19px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
}

.title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin: 0 0 12px;
}

.meta {
  margin-bottom: 14px;
}

.meta-row {
  display: flex;
  margin-bottom: 10px;
  font-size: 14px;
}

.meta-label,
.meta-value {
  color: #333;
}

.meta-label {
  flex: 0 0 56px;
}

.story-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  line-height: 1.8;
  font-size: 15px;
  color: #333;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resources table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resources th,
.resources td {
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.resources th {
  color: #888;
  font-weight: 500;
}

.footer {
  text-align: center;
  font-size: 11px;
  color: #aaa;
  margin-bottom: 20px;
}

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

.choice-btn {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e4e2de;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.choice-btn:hover {
  background: #f5f4f2;
  border-color: #d8d5d0;
  transform: scale(0.99);
}

.choice-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.choice-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.choice-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #24243e;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-key {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
}

.choice-arrow {
  color: #999;
}

.choice-desc {
  font-size: 13px;
  color: #555;
  margin: 0;
  line-height: 1.6;
}

.mask {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #555;
}

/* 同上：用 :not([hidden]) 代替直接写 display:flex，避免覆盖 hidden 属性的隐藏效果 */
.mask:not([hidden]) {
  display: flex;
}

#life-screen .tip {
  text-align: center;
  color: #c0392b;
}

.store {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.store-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.store-title {
  font-weight: 700;
  font-size: 14px;
}

.store-badge {
  font-size: 11px;
  background: #e8f6ec;
  color: #1a7f3c;
  padding: 2px 8px;
  border-radius: 10px;
}

.store-desc {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px;
}

.restore-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: none;
  border: 1px solid #e4e2de;
  border-radius: 10px;
  color: #555;
  font-size: 13px;
  cursor: pointer;
}

.restore-btn:hover {
  background: #f5f4f2;
}

.store-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: #c0392b;
}

/* Desktop / large-screen enhancements */
@media (min-width: 768px) {
  body {
    background: #efece7;
  }

  #welcome-screen {
    padding: 64px 24px;
  }

  .brand-mark {
    font-size: 60px;
  }

  .brand-title {
    font-size: 38px;
  }

  .brand-sub {
    font-size: 15px;
    max-width: 480px;
  }

  #life-screen {
    justify-content: center;
    padding: 40px 24px;
    min-height: 100vh;
    align-items: flex-start;
  }

  /* 同上：避免覆盖 hidden 属性 */
  #life-screen:not([hidden]) {
    display: flex;
  }

  .life {
    max-width: 720px;
    width: 100%;
    margin: 0;
    padding: 36px 40px 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  }

  .universe {
    font-size: 21px;
  }

  .title {
    font-size: 19px;
  }

  .story-box {
    font-size: 16px;
    padding: 20px 22px;
  }

  .choices {
    flex-direction: row;
  }

  .choice-btn {
    flex: 1;
  }

  .mask {
    border-radius: 20px;
  }
}
