:root {
  --bg-1: #dffcff;
  --bg-2: #bdf4f7;
  --bg-3: #8fe7ee;
  --bg-4: #5fd5df;
  --tiffany: #81d8d0;
  --tiffany-deep: #4ebfba;
  --tiffany-night: #23959c;
  --ink: #12343a;
  --muted: #4f6f75;
  --white: rgba(255,255,255,0.72);
  --white-strong: rgba(255,255,255,0.84);
  --border: rgba(255,255,255,0.52);
  --shadow: 0 22px 55px rgba(28, 105, 113, 0.18);
  --shadow-strong: 0 30px 70px rgba(22, 87, 93, 0.24);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--ink);
}

.theme-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.92), transparent 30%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 36%, var(--bg-3) 70%, var(--bg-4));
  position: relative;
  overflow-x: hidden;
}

.member-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.16), transparent 30%),
    radial-gradient(circle at 20% 15%, rgba(255,255,255,0.28), transparent 18%),
    radial-gradient(circle at 80% 10%, rgba(129,216,208,0.28), transparent 20%);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  opacity: 0.9;
}

.bg-orb-1 {
  top: 90px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.8), rgba(129,216,208,0.18) 60%, transparent 75%);
}

.bg-orb-2 {
  top: 280px;
  right: -30px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(104,221,223,0.45), rgba(255,255,255,0.15) 58%, transparent 74%);
}

.bg-orb-3 {
  bottom: 120px;
  left: 18px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.55), rgba(94,209,216,0.2) 60%, transparent 75%);
}

.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 16px 28px;
  position: relative;
  z-index: 1;
}

.login-shell {
  display: flex;
  align-items: center;
}

.glass-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.58));
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.38), transparent 38%, transparent 70%, rgba(255,255,255,0.18));
}

.login-card {
  width: 100%;
  padding: 24px 20px;
}

.brand-pill, .status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(129, 216, 208, 0.24);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

h1 {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h3 {
  margin: 8px 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.subtext, .hero-card p, .future-card li, .tool-copy, .empty-note, .recent-file-meta, .result-meta, .hero-note {
  color: var(--muted);
  line-height: 1.55;
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.compact-form {
  margin-top: 12px;
}

.field-label, .label, .eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2b5f66;
}

input, .form-select-like, textarea {
  width: 100%;
  border: 1px solid rgba(78, 191, 186, 0.18);
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px 17px;
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

input:focus, .form-select-like:focus, textarea:focus {
  border-color: var(--tiffany-deep);
  box-shadow: 0 0 0 4px rgba(129, 216, 208, 0.18), 0 10px 24px rgba(78,191,186,0.12);
}

.primary-btn, .ghost-btn, .text-toggle-btn {
  border: none;
  border-radius: 18px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn:hover, .ghost-btn:hover, .text-toggle-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  margin-top: 8px;
  color: white;
  background: linear-gradient(180deg, #57d0c8, #35aba5);
  box-shadow: 0 16px 30px rgba(53, 171, 165, 0.28), inset 0 1px 0 rgba(255,255,255,0.2);
}

.ghost-btn {
  background: rgba(255,255,255,0.72);
  color: var(--ink);
  border: 1px solid rgba(78, 191, 186, 0.14);
  box-shadow: 0 10px 20px rgba(28,105,113,0.08);
}

.text-toggle-btn {
  padding: 0;
  background: transparent;
  color: #2b5f66;
  font-size: 15px;
  font-weight: 800;
}

.wide-btn {
  width: 100%;
}

.alert-error, .alert-info {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 18px;
  font-size: 14px;
}

.alert-error {
  background: rgba(255, 114, 114, 0.12);
  color: #9a2f2f;
  border: 1px solid rgba(255,114,114,0.12);
}

.alert-info {
  background: rgba(78, 191, 186, 0.14);
  color: #1f5f63;
  border: 1px solid rgba(78,191,186,0.14);
}

.helper-card {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(78, 191, 186, 0.12);
}

.forgot-panel[hidden] {
  display: none;
}

.topbar, .hero-card, .future-card, .info-card, .member-tool-card {
  padding: 18px;
}

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

.topbar-card {
  border-radius: 28px;
}

.topbar-btn {
  min-width: 82px;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.premium-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 14px;
  align-items: stretch;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.86), rgba(203,251,255,0.48)),
    linear-gradient(180deg, rgba(95,213,223,0.16), transparent);
  box-shadow: var(--shadow-strong);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,0.42), transparent 26%);
}

.hero-copy, .hero-badge-stack {
  position: relative;
  z-index: 1;
}

.hero-badge-stack {
  display: grid;
  gap: 10px;
}

.hero-mini-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.hero-mini-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-mini-card strong {
  font-size: 16px;
}

.info-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card.featured {
  grid-column: 1 / -1;
}

.featured-expiry {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.42), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(220,255,255,0.64));
}

.card-glow {
  position: absolute;
  right: -12px;
  top: -14px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(129,216,208,0.34), transparent 68%);
  pointer-events: none;
}

.premium-info-card {
  min-height: 126px;
}

.value {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  word-break: break-word;
  position: relative;
  z-index: 1;
}

.value.large {
  font-size: 31px;
  letter-spacing: -0.03em;
}

.email-value {
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: normal;
}

.member-tool-card {
  display: grid;
  gap: 16px;
}

.premium-tool-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.85), rgba(234,255,255,0.6));
  box-shadow: var(--shadow-strong);
}

.tool-header {
  display: grid;
  gap: 12px;
}

.renewal-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-stats {
  display: grid;
  gap: 10px;
}

.tool-stat {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.56);
  border-radius: 16px;
}

.accent-stat {
  background: linear-gradient(135deg, rgba(129,216,208,0.22), rgba(255,255,255,0.56));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.radio-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(78, 191, 186, 0.16);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.radio-pill input {
  width: auto;
  margin: 0;
}

.premium-submit-btn {
  width: 100%;
}

.demo-loading {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255,255,255,0.56);
  color: var(--muted);
  font-size: 14px;
}

.demo-loading.active {
  display: inline-flex;
}

.demo-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(78, 191, 186, 0.25);
  border-top-color: var(--tiffany-deep);
  animation: spin 0.8s linear infinite;
}

.download-result-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,0.72), rgba(214,251,255,0.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.result-title, .recent-file-title {
  font-size: 16px;
  font-weight: 800;
  margin-top: 8px;
}

.inline-download-btn {
  margin-top: 12px;
}

.recent-files-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.recent-file-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.56);
  border: 1px solid rgba(255,255,255,0.35);
}

.recent-file-btn {
  white-space: nowrap;
}

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

.inline-action-form {
  margin: 0;
}

.danger-ghost-btn {
  color: #a13b52;
  border-color: rgba(161, 59, 82, 0.16);
  background: rgba(255,255,255,0.8);
}

.premium-future-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(234,255,255,0.52));
}

.future-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

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

@media (max-width: 520px) {
  .app-shell { padding: 16px 14px 24px; }
  .login-card { padding: 22px 16px; }
  h1 { font-size: 25px; }
  h2 { font-size: 25px; }
  .premium-hero { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .value.large { font-size: 25px; }
  .recent-file-item { align-items: flex-start; flex-direction: column; }
  .recent-file-actions { width: 100%; flex-direction: column; }
  .recent-file-btn { width: 100%; }
}
