/* ===== CSS Variables ===== */
:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --line: #d9e0ef;
  --text: #1d2433;
  --sub: #5b657a;
  --accent: #ff8e3c;
  --accent-strong: #ff6b00;
  --soft: #fff3e8;
  --shadow: 0 12px 30px rgba(26, 36, 56, 0.08);
  --shadow-hover: 0 20px 48px rgba(26, 36, 56, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(255, 142, 60, 0.14), transparent 24%),
    linear-gradient(180deg, #fffaf5 0%, var(--bg) 22%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== Layout ===== */
.container,
.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* ===== Page header (hero) ===== */
.hero {
  padding: 64px 0 36px;
}

.eyebrow,
.kicker {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.15;
}

.lead,
.intro {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--sub);
  font-size: 16px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: #c5d0e6;
  box-shadow: 0 6px 20px rgba(26,36,56,0.1);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

/* ===== Site header (non-hero pages) ===== */
.site-header.simple-header {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  background: linear-gradient(180deg, #fffaf4 0%, transparent 100%);
}

.header-inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  flex-shrink: 0;
  padding-top: 4px;
}

/* ===== Back / nav link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--accent-strong); }
.back-link::before { content: "←"; }

/* ===== Index page: hero-actions ===== */
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ===== Main content grid (stamp-settings) ===== */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding-bottom: 48px;
}

/* ===== Sections / Cards ===== */
.notice,
.group,
.next-box,
.quick-guide-card,
.detail-card,
.upload-screen-card {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(217, 224, 239, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.notice {
  padding: 20px 22px;
  background: linear-gradient(180deg, #fffaf4 0%, #ffffff 100%);
}

.notice strong { display: inline-block; margin-bottom: 6px; }

.group,
.quick-guide-card,
.detail-card {
  padding: 28px;
  margin-bottom: 20px;
}

.group-header { margin-bottom: 18px; }

.group-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group h2,
.quick-guide-card h2,
.detail-card h2 {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.2;
}

/* ===== Card grid ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.card.wide { grid-column: 1 / -1; }

.card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--sub);
}

.field-value {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid #ffd7bb;
  font-weight: 700;
  color: #512d10;
  word-break: break-word;
}

.field-value.multiline {
  display: block;
  font-weight: 600;
}

.url-wrap a { color: inherit; text-decoration: none; }
.url-wrap a:hover { text-decoration: underline; }

.simple-list {
  display: grid;
  gap: 10px;
  color: var(--sub);
}

/* ===== Step list ===== */
.step-list {
  margin: 0 0 20px;
  padding-left: 1.4em;
  display: grid;
  gap: 10px;
}

.step-list li { padding-left: 4px; }

/* ===== Callout ===== */
.callout {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
}

.callout.warn {
  background: #fffbf0;
  border: 1px solid #ffe0a0;
}

.callout strong { display: block; margin-bottom: 4px; }
.callout p { margin: 0; }

/* ===== Tag page layout ===== */
.tag-page-layout {
  display: grid;
  gap: 20px;
  padding-bottom: 48px;
}

/* ===== Upload screen card ===== */
.upload-screen-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.upload-screen-card.tag-reference-card { margin-bottom: 0; }

.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1f2937;
  color: #fff;
}

.screen-title {
  font-size: 15px;
  font-weight: 700;
}

.screen-title.small-title { font-size: 13px; }

.screen-actions { display: flex; gap: 10px; }

.fake-upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  background: #4f8ef7;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}

.fake-upload-btn:hover { background: #3b72e0; }

.screen-guide-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: #fffbf0;
  border-bottom: 1px solid #ffe0a0;
  font-size: 14px;
}

.guide-badge {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 2px;
}

.screen-figure {
  margin: 0;
  padding: 20px;
}

.screen-figure img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sub);
  text-align: center;
}

/* ===== Upload layout ===== */
.upload-layout {
  display: grid;
  gap: 20px;
  padding-bottom: 48px;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--sub);
  font-size: 15px;
}

.plain-list li::before { content: "・"; color: var(--accent); }

/* ===== Tag table ===== */
.tag-table-card { margin-bottom: 0; }

.tag-table {
  display: grid;
  gap: 12px;
}

.tag-row {
  display: grid;
  grid-template-columns: 40px 110px 1fr 52px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbff;
  font-size: 14px;
}

.tag-no {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-strong);
  text-align: center;
}

.tag-thumb-label {
  color: var(--sub);
  font-size: 12px;
}

.tag-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #ffd7bb;
  font-size: 13px;
  font-weight: 600;
  color: #512d10;
}

.tag-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 8px;
  background: #e8edf7;
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
  cursor: default;
  white-space: nowrap;
}

/* ===== TOP page specific ===== */
.top-hero {
  padding: 72px 0 48px;
  text-align: center;
}

.top-hero .eyebrow { justify-content: center; display: block; }
.top-hero h1 { font-size: clamp(28px, 5vw, 52px); }
.top-hero .lead { margin: 16px auto 0; text-align: center; }

.page-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 64px;
}

.page-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(217, 224, 239, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #ffb87a;
}

.page-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.page-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.page-card p {
  margin: 0;
  color: var(--sub);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}

.page-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .page-cards { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; }
  .header-actions { flex-direction: row; }
  .tag-row { grid-template-columns: 36px 90px 1fr 44px; }
}

@media (max-width: 640px) {
  .top-hero { padding: 48px 0 32px; text-align: left; }
  .top-hero .lead { text-align: left; }
  .hero { padding-top: 40px; }
  .cards { grid-template-columns: 1fr; }
  .group, .notice, .next-box, .quick-guide-card, .detail-card { padding: 18px; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
  .tag-row { grid-template-columns: 32px 1fr; grid-template-rows: auto auto auto; }
  .tag-thumb-label { display: none; }
  .tag-edit-btn { display: none; }
}
