/* LINE 綁定頁專用樣式；共用元件見 /styles.css。 */
.line-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.line-sub strong { color: var(--ink); }
.line-meta { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.line-error { color: var(--red); overflow-wrap: anywhere; }
.line-nowrap { white-space: nowrap; }

/* 頭像 */
.line-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent-s); color: var(--accent-d); font-weight: 700; font-size: 13px; }
.line-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.line-who strong { display: block; }

/* 綁定碼 */
.line-code { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: 0 10px; }
.line-code code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 19px; font-weight: 700; letter-spacing: .08em; color: var(--accent-d); }
.line-code .line-meta { grid-column: 1 / -1; }
.line-code-mini { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 7px; background: var(--soft); border: 1px solid var(--line); flex: 0 0 auto; }

/* 剛產生的綁定碼 */
.line-fresh {
  display: flex; align-items: center; gap: 14px 24px; flex-wrap: wrap; padding: 16px 18px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-s) 85%, transparent), transparent 70%) var(--card);
}
.line-fresh-main { display: flex; flex-direction: column; gap: 2px; }
.line-fresh-main .muted { font-size: 12px; }
.line-fresh-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 38px; font-weight: 800; letter-spacing: .12em; line-height: 1.15; color: var(--accent-d); }
.line-fresh-howto { margin: 0; flex: 1 1 240px; min-width: 0; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.line-fresh-howto p { margin: 0; }
.line-fresh-link { color: var(--accent-d); font-size: 13px; font-weight: 700; align-self: flex-start; }
.line-copies { display: inline-flex; gap: 10px; white-space: nowrap; }
.line-fresh-howto strong { color: var(--ink); }
.line-fresh-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* 綁定狀態表 */
.line-table td { vertical-align: middle; }
.line-table th.line-ops, .line-table td.line-ops { text-align: right; }
.line-group td { padding: 8px 16px; background: var(--soft); font-size: 12px; font-weight: 700; color: var(--muted); }
.line-group em { font-style: normal; font-weight: 500; margin-left: 6px; font-variant-numeric: tabular-nums; }
.line-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* 兩欄清單 */
.line-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.line-list { max-height: 420px; overflow: auto; }
.line-list-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.line-list-row:last-child { border-bottom: 0; }
.line-list-main { flex: 1 1 auto; min-width: 0; }
.line-list-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-list-row .pill { max-width: 45%; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .line-cols { grid-template-columns: 1fr; }
  .line-fresh-code { font-size: 32px; }
  .line-fresh-actions { margin-left: 0; }
}

/* 窄螢幕：表格每列改成固定排法的小卡，不必左右捲動。 */
@media (max-width: 900px) {
  .line-stack thead { display: none; }
  .line-stack, .line-stack tbody { display: block; }
  .line-stack tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .line-stack tbody tr:last-child { border-bottom: 0; }
  .line-stack td { display: block; padding: 0; border: 0; min-width: 0; }
  .line-stack .line-meta { display: block; margin-left: 0; }
  .line-stack tr.line-group { display: block; padding: 8px 16px; background: var(--soft); }
  .line-stack tr.line-group td { padding: 0; }

  /* 綁定狀態：第一行名稱＋狀態，接著 LINE 帳號、綁定碼，最後一行操作靠右。 */
  .line-table td.line-main { grid-column: 1; grid-row: 1; }
  .line-table td.line-st { grid-column: 2; grid-row: 1; justify-self: end; }
  .line-table td.line-acct, .line-table td.line-cd, .line-table td.line-ops { grid-column: 1 / -1; }
  .line-table td:has(> .line-dash) { display: none; }
  .line-table .line-actions { justify-content: flex-end; }

  /* 通知：第一行內容＋狀態，第二行對象與時間。 */
  .line-notify tbody tr { grid-template-areas: "main st" "to time"; align-items: start; }
  .line-notify td.line-main { grid-area: main; }
  .line-notify td.line-st { grid-area: st; justify-self: end; }
  .line-notify td.line-to { grid-area: to; display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
  .line-notify td.line-to .line-meta { display: inline; }
  .line-notify td.line-time { grid-area: time; justify-self: end; font-size: 12px; color: var(--muted); }
}
