:root {
  --primary: #7c5cbf;
  --primary-light: #9b7ed4;
  --primary-dark: #5a3fa0;
  --accent: #e8b86d;
  --bg: #faf9f7;
  --text: #2d2d2d;
  --text-muted: #6b6b6b;
  --border: #e5e0f0;
  --radius: 14px;
  --shadow: 0 2px 20px rgba(124,92,191,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Noto Serif TC", Georgia, serif; background: var(--bg); color: var(--text); }

nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,247,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 60px;
}
nav .logo { font-size: 1.2rem; font-weight: 700; color: var(--primary); text-decoration: none; }
nav .nav-right { display: flex; align-items: center; gap: 1rem; }
#credits-badge {
  display: none; background: var(--primary); color: white;
  font-family: sans-serif; font-size: 0.85rem; padding: 0.3rem 0.85rem;
  border-radius: 20px; cursor: pointer; white-space: nowrap;
}
#credits-badge.low { background: #e65100; }
#nav-login-btn {
  font-family: sans-serif; font-size: 0.9rem; background: none;
  border: 1.5px solid var(--primary); color: var(--primary); border-radius: 20px;
  padding: 0.3rem 1rem; cursor: pointer;
}
#nav-login-btn:hover { background: var(--primary); color: white; }

.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Hero ── */
.plans-hero { padding: 3.5rem 0 2.5rem; text-align: center; }
.plans-hero h1 { font-size: 2rem; color: var(--primary-dark); margin-bottom: 0.5rem; }
.plans-hero p { color: var(--text-muted); font-size: 1.05rem; }
.trial-note {
  display: inline-block; margin-top: 1rem;
  background: #e8f5e9; color: #2e7d32; border-radius: 20px;
  padding: 0.3rem 1rem; font-family: sans-serif; font-size: 0.85rem;
}

/* ── 方案 Grid ── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0 3rem;
}

.plan-card {
  background: white; border: 2px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 1.5rem;
  text-align: center; box-shadow: var(--shadow);
  position: relative; transition: transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 6px 28px rgba(124,92,191,0.18); }
.plan-card.featured { border-color: var(--primary); }

.plan-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: white;
  font-family: sans-serif; font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.9rem; border-radius: 20px; white-space: nowrap;
}

.plan-name { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); }
.plan-credits { font-size: 2.2rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.plan-credits span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.plan-price { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.plan-price small { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }

.plan-per-credit { font-family: sans-serif; font-size: 0.88rem; color: var(--text-muted); }

.plan-savings {
  font-family: sans-serif; font-size: 0.82rem; font-weight: 600;
  color: #2e7d32; background: #e8f5e9; border-radius: 6px; padding: 0.2rem 0.5rem;
  display: inline-block;
}

.plan-divider { border: none; border-top: 1px solid var(--border); margin: 0.25rem 0; }

/* 付款方式選擇 */
.payment-methods { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.pay-btn {
  flex: 1; padding: 0.55rem 0.5rem; border-radius: 8px;
  font-family: sans-serif; font-size: 0.85rem; cursor: pointer;
  border: 1.5px solid var(--primary); background: var(--primary); color: white;
  transition: background 0.15s;
}
.pay-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.pay-btn.paypal { background: #009cde; border-color: #009cde; }
.pay-btn.paypal:hover { background: #007bb5; }
.pay-btn:disabled { background: #ccc; border-color: #ccc; cursor: not-allowed; }

/* PayPal 容器 */
.paypal-container { margin-top: 0.5rem; }

/* ── 登入提示 ── */
.login-notice {
  background: #f3f0fa; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  text-align: center; font-family: sans-serif; margin-bottom: 2rem;
}
.login-notice p { color: var(--text-muted); margin-bottom: 0.75rem; }
.login-notice button {
  background: var(--primary); color: white; border: none;
  border-radius: 20px; padding: 0.5rem 1.5rem;
  font-size: 0.95rem; cursor: pointer;
}
.login-notice button:hover { background: var(--primary-dark); }

/* ── Modal（從 main.css 複製） ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius);
  padding: 2rem; width: 420px; max-width: 95vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2); position: relative;
}
.modal h2 { font-size: 1.4rem; color: var(--primary-dark); margin-bottom: 0.3rem; }
.modal .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; font-family: sans-serif; }
.modal .close-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); }
.modal-tabs { display: flex; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.modal-tab { flex: 1; padding: 0.6rem; text-align: center; cursor: pointer; font-family: sans-serif; font-size: 0.95rem; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-family: sans-serif; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.form-group input { width: 100%; padding: 0.65rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; outline: none; }
.form-group input:focus { border-color: var(--primary); }
.modal-submit { width: 100%; background: var(--primary); color: white; border: none; border-radius: 50px; padding: 0.75rem; font-size: 1rem; cursor: pointer; font-family: sans-serif; margin-top: 0.5rem; }
.modal-submit:hover { background: var(--primary-dark); }
.modal-error { color: #c62828; font-family: sans-serif; font-size: 0.85rem; margin-top: 0.5rem; }

footer { border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; color: var(--text-muted); font-size: 0.9rem; font-family: sans-serif; }
