/* --- 頁面色票：跟卡片同一組，深淺兩版 --- */
:root {
  --page: #f2f2f4;
  --surface: #ffffff;
  --ink: #2b2b2b;
  --muted: #5d5d5d;
  --line: #dcdce2;
  --sunk: #e9eaef;
  --accent: #4d84cc;
  --font-han: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-latin: "JetBrains Mono", monospace;
}

[data-theme="dark"] {
  --page: #1e2127;
  --surface: #282c34;
  --ink: #dcdfe4;
  --muted: #8b929e;
  --line: #3a3f4a;
  --sunk: #2f333d;
  --accent: #7aa9e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 24px 72px;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-han);
  font-size: 15px;
  line-height: 1.7;
}

/* --- 頁首 --- */
.masthead {
  max-width: 1180px;
  margin: 0 auto 28px;
}

.masthead h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.masthead p {
  margin: 0;
  max-width: 640px;
  font-size: 14px;
  color: var(--muted);
}

/* --- 兩欄：左表單、右卡片 --- */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
}

/* --- 表單 --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

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

.label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.label em {
  font-family: var(--font-latin);
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}

input[type="text"],
textarea {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* --- 一排並列的小按鈕 --- */
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- emoji 選單：只放 emoji，滑過去才看英文名 --- */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
}

.chip {
  font: inherit;
  font-size: 22px;
  line-height: 1;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--page);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease;
}

.chip:hover {
  border-color: var(--muted);
}

.chip[aria-pressed="true"] {
  border-color: transparent;
  transform: scale(1.08);
}

/* --- 按鈕 --- */
button {
  font: inherit;
  cursor: pointer;
}

.ghost {
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ghost:hover {
  border-color: var(--muted);
}

.solid {
  font-size: 15px;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  flex: 1;
}

.solid.outline {
  background: transparent;
  color: var(--accent);
}

.solid.outline:hover {
  background: var(--accent);
  color: #ffffff;
}

/* --- 卡片預覽 --- */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.board {
  width: 100%;
  max-width: 420px;
}

#card {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.14);
  touch-action: pan-y;
  cursor: grab;
}

#card:active {
  cursor: grabbing;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

/* --- IG 打卡的三步驟說明 --- */
.howto {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.howto-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.howto-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  counter-reset: step;
}

.howto-steps li {
  counter-increment: step;
}

.howto-steps li::before {
  content: counter(step) ". ";
}

/* --- 下載鈕底下的入口 --- */
.joinus {
  width: 100%;
  max-width: 420px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
}

.joinus:hover {
  background: var(--accent);
  border-color: transparent;
  color: #ffffff;
}
