/* ── Variables ── */
:root {
  --blue:       #005DAA;
  --blue-dark:  #004a8a;
  --red:        #E31837;
  --gray-bg:    #F5F5F5;
  --gray-light: #eeeeee;
  --gray-mid:   #cccccc;
  --gray-text:  #666666;
  --text:       #222222;
  --white:      #ffffff;
  --border:     #dddddd;
  --warning-bg: #fff8e1;
  --warning-bd: #f9a825;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--gray-bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

/* ── Container ── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 2px;
  border: none;
  transition: background 0.2s;
}

.btn--primary {
  background: var(--blue);
  color: var(--white);
}
.btn--primary:hover { background: var(--blue-dark); }

.btn--outline {
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--blue);
}
.btn--outline:hover { background: var(--gray-light); }

.btn--full { width: 100%; text-align: center; }

/* ── ① Top Nav ── */
.top-nav {
  background: #f2f2f2;
}
.top-nav__inner {
  display: flex;
  justify-content: flex-end;
  padding: 7px 32px;
}
.top-nav__links {
  display: flex;
  gap: 20px;
}
.top-nav__links a { color: var(--blue); font-size: 16px; }

/* ── ② Header ── */
.header {
  background: #f2f2f2;
  padding: 12px 32px;
  border-bottom: 4px solid var(--blue);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__logo { flex-shrink: 0; }
.logo-img {
  height: 88px;
  width: auto;
  display: block;
}

.header__search {
  flex: 1;
  display: flex;
  border: 1px solid var(--blue);
  margin: 0 24px;
}
.header__search input {
  flex: 1;
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  outline: none;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
}
.header__search button {
  padding: 10px 20px;
  background: var(--white);
  color: var(--blue);
  border: none;
  border-left: 1px solid var(--blue);
  cursor: pointer;
  font-size: 20px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.header__actions a {
  color: var(--blue);
  font-size: 17px;
  white-space: nowrap;
  font-weight: 500;
  padding: 0 20px;
}
.header__actions a + a {
  border-left: 1px solid var(--border);
}

/* ── ③ Category Nav ── */
.cat-nav {
  background: #0060af;
}
.cat-nav__inner {
  display: flex;
  flex-wrap: nowrap;
  padding: 0 24px;
  align-items: center;
}
.cat-nav__inner a {
  color: var(--white);
  padding: 14px 20px;
  font-size: 19.6px;
  white-space: nowrap;
  display: block;
  font-weight: 500;
}
.cat-nav__inner a:first-child {
  margin-right: auto;
}
.cat-nav__inner a:hover {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

/* ── ④ Breadcrumb ── */
.breadcrumb {
  background: var(--white);
  padding: 8px 0;
  font-size: 13px;
  color: var(--gray-text);
}
.breadcrumb a { color: var(--gray-text); }
.breadcrumb span { color: var(--text); }

/* ── ⑤ Page Title ── */
.page-title {
  background: var(--white);
  padding: 16px 0 8px;
}
.page-title h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.required-note {
  font-size: 12px;
  color: var(--red);
}

/* ── ⑥⑦ Main Grid ── */
.main {
  padding: 24px 0 40px;
  background: var(--white);
}
.main__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Card ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 28px;
}

/* ── Login Card inner layout ── */
.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-card .form-group {
  width: 80%;
}
.login-card .form-check {
  width: 80%;
}
.login-card .forgot-links {
  width: 80%;
  text-align: center;
}
.login-card .btn--full {
  width: 80%;
}

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.required { color: var(--red); margin-left: 2px; }

.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--gray-mid);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  border-radius: 0;
  background: var(--white);
}
.form-group input:focus { border-color: var(--blue); }
.form-group input.invalid { border-color: var(--red); }

.password-wrap {
  position: relative;
  display: flex;
  width: 100%;
}
.password-wrap input { flex: 1; }
.toggle-pw {
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  border-left: none;
  padding: 0 10px;
  cursor: pointer;
  font-size: 16px;
}

.error-msg {
  display: none;
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
}
.error-msg.show { display: block; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.form-check input[type="checkbox"] { accent-color: var(--blue); }

.forgot-links {
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--blue);
  text-align: center;
}

/* ── ⑦ Register Card ── */
.register-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.register-top, .register-bottom {
  padding: 32px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.register-top { border-bottom: none; }
.register-top p, .register-bottom p {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--gray-text);
  text-align: center;
}
.register-top .btn,
.register-bottom .btn {
  width: 85%;
}

/* ── ⑧ Info Section ── */
.info-section {
  background: var(--gray-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}
.info-section__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.info-item__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 24px;
  color: var(--blue);
}
a.info-item__title {
  color: var(--blue);
  text-decoration: none;
}
a.info-item__title:hover { text-decoration: underline; }

.info-item input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-mid);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--white);
}
.social-links { display: flex; gap: 10px; margin-top: 4px; }
.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
.social-links a:nth-child(1) { background: #1877f2; }
.social-links a:nth-child(2) { background: #06c755; }
.social-links a:nth-child(3) { background: #e1306c; }

/* ── ⑨ Fraud Warning ── */
.fraud-banner {
  background: var(--gray-bg);
  padding: 16px 0;
}
.fraud-banner .container {
  background: #fafafa;
  border: none;
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}

/* ── ⑩ Footer Nav ── */
.footer {
  background: var(--gray-bg);
  padding: 40px 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}
.footer-col h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 20px;
  color: var(--text);
}
.footer-col h3:first-child { margin-top: 0; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: var(--gray-text); font-size: 16px; }
.footer-col ul li a:hover { color: var(--blue); }

.app-badges { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.app-badge {
  display: block;
  background: var(--text);
  color: var(--white);
  text-align: center;
  padding: 8px;
  font-size: 13px;
  border-radius: 8px;
}

.member-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.member-card {
  border: 1px solid var(--gray-mid);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 2px;
}
.member-card--black {
  background: #222;
  color: var(--white);
  border-color: #222;
}

/* ── ⑪ Legal Footer ── */
.legal-footer {
  background: var(--gray-bg);
  border-top: 1px solid var(--border);
  padding: 20px 0;
}
.legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.legal-footer__links a {
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
}
.legal-footer__links a:hover { color: var(--blue); }
.legal-footer__copy {
  color: var(--gray-text);
  font-size: 14px;
  margin-top: 4px;
  text-align: center;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  padding: 36px 32px;
  max-width: 440px;
  width: 90%;
  border-top: 4px solid var(--red);
  border-radius: 2px;
}
.modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.modal p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-text);
  margin-bottom: 12px;
}
.modal .btn { margin-top: 8px; display: block; margin-left: auto; margin-right: auto; }

/* ── RWD ── */
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .info-section__grid { grid-template-columns: repeat(2, 1fr); }
  .cat-nav__inner a { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 640px) {
  .main__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .info-section__grid { grid-template-columns: 1fr; }
  .header__inner { flex-wrap: wrap; }
  .header__search { order: 3; width: 100%; }
  .header__actions { gap: 10px; }
  .top-nav__links { gap: 10px; font-size: 11px; }
  .cat-nav__inner { overflow-x: auto; flex-wrap: nowrap; }
}
