/* Poetry Assistant — shared styles (public/css/style.css)
 * Fleet style: big-company minimal. White ground, near-black text,
 * one restrained blue accent, generous whitespace. One codebase for
 * phone / PC / iPad — iPad gets the full desktop layout, nothing cut.
 */
:root {
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #a1a1a6;
  --line: #e5e5ea;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --danger: #d70015;
  --ok: #1d7a3d;
  --ping: #0071e3;
  --ze: #c25e00;
  --radius: 16px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- header / nav ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-size: 19px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 6px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav a:hover { background: var(--bg-soft); text-decoration: none; }
.nav a.active { color: var(--accent); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.badge { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: var(--bg-soft); white-space: nowrap; }
.badge-ok { color: var(--ok); border-color: #bfe3c8; background: #eef8f0; }
.badge-demo { color: #8a6d00; border-color: #f0dc9a; background: #fff8e1; }
.lang-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--ink); }
.lang-btn:hover { background: var(--bg-soft); }

/* ---- hero ---- */
.hero { text-align: center; padding: 72px 20px 48px; }
.hero h1 { font-size: 44px; margin-bottom: 16px; }
.hero .sub { font-size: 19px; color: var(--ink-2); max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.noads { margin-top: 28px; font-size: 14px; color: var(--ink-2); }

/* ---- buttons / forms ---- */
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 11px 22px; font-size: 15px; font-weight: 600; cursor: pointer; background: var(--accent); color: #fff; text-align: center; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.ghost { background: var(--bg-soft); color: var(--ink); }
.btn.ghost:hover { background: #e8e8ed; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f0b6bd; }
.btn.danger:hover { background: #fdf0f1; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
  font-size: 15px; font-family: var(--font); color: var(--ink); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.15); }
textarea { resize: vertical; min-height: 180px; line-height: 1.9; font-family: var(--serif); font-size: 18px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }

/* ---- sections / cards ---- */
.section { padding: 40px 0; }
.section h2 { font-size: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 14px; margin-bottom: 0; }
.card .price { font-size: 34px; font-weight: 700; margin: 8px 0; }
.card .price small { font-size: 14px; color: var(--ink-2); font-weight: 400; }
.card.featured { border-color: var(--accent); box-shadow: 0 8px 30px rgba(0,113,227,.12); }
.card ul { margin: 0 0 16px; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.card ul li { margin-bottom: 6px; }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; color: var(--ink-2); }
.center { text-align: center; }
.mt { margin-top: 24px; }
.mb { margin-bottom: 24px; }

/* ---- poem display ---- */
.poem-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--bg-soft); }
.poem-title { font-family: var(--serif); font-size: 24px; text-align: center; }
.poem-meta { text-align: center; color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.poem-body { font-family: var(--serif); font-size: 19px; line-height: 2.1; text-align: center; white-space: pre-line; }
.poem-list { display: grid; gap: 12px; }
.poem-item { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--ink); }
.poem-item:hover { border-color: var(--accent); text-decoration: none; }
.poem-item h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 4px; }
.poem-item .meta { font-size: 13px; color: var(--ink-2); }
.poem-item .snippet { font-family: var(--serif); color: var(--ink-2); font-size: 15px; margin-top: 8px; }

/* ---- meter check ---- */
.check-line { font-family: var(--serif); font-size: 19px; line-height: 2.2; margin-bottom: 10px; }
.check-char { display: inline-block; text-align: center; margin-right: 2px; }
.check-char .ch { display: block; }
.check-char .mark { display: block; font-size: 11px; font-family: var(--font); line-height: 1.2; border-radius: 4px; padding: 1px 3px; }
.tone-ping .mark { color: var(--ping); background: rgba(0,113,227,.08); }
.tone-ze .mark { color: var(--ze); background: rgba(194,94,0,.08); }
.tone-unknown .mark { color: var(--ink-3); background: var(--bg-soft); }
.result-block { margin-top: 20px; }
.result-block h3 { font-size: 16px; }
.issue { color: var(--danger); font-size: 14px; margin-bottom: 4px; }
.ok-note { color: var(--ok); font-size: 14px; }

/* ---- works ---- */
.work-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.work-item h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.work-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.version-list { display: grid; gap: 10px; margin-top: 12px; }
.version-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.version-item pre { font-family: var(--serif); font-size: 15px; white-space: pre-wrap; margin: 8px 0 0; color: var(--ink-2); }
.version-item .v-body { flex: 1; min-width: 220px; }

/* ---- misc ---- */
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--bg-soft); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.notice { border: 1px solid #f0dc9a; background: #fff8e1; color: #6d5700; border-radius: 12px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px; }
.notice.err { border-color: #f0b6bd; background: #fdf0f1; color: var(--danger); }
.notice.ok { border-color: #bfe3c8; background: #eef8f0; color: var(--ok); }
.appreciate-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg-soft); font-size: 15px; line-height: 1.9; white-space: pre-line; }
.quota { font-size: 13px; color: var(--ink-2); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 40px; color: var(--ink-2); font-size: 13px; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; max-width: 88vw; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 100; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.empty { text-align: center; color: var(--ink-2); padding: 48px 0; }
.narrow { max-width: 560px; margin: 0 auto; }

/* ---- responsive: one codebase, full function on iPad ---- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 600px) {
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 48px 20px 32px; }
  .hero h1 { font-size: 28px; }
  .hero .sub { font-size: 16px; }
  .brand small { display: none; }
  .site-header .container { gap: 8px; }
  .work-item { flex-direction: column; }
  textarea { font-size: 17px; }
}
