/* パターン3-2 モダン（修正版）：検索中心・1列表示・青緑 */
:root {
  --c-main: #0f6b66; --c-main-dark: #0a4f4b; --c-accent: #e2672b;
  --c-text: #1f2933; --c-sub: #5b6875; --c-line: #e2e8ee;
  --c-bg: #f5f7f9; --c-card: #fff; --radius: 12px; --w-max: 1120px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--c-text); background: var(--c-bg); line-height: 1.75; }
a { color: var(--c-main); }
.container { max-width: var(--w-max); margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--c-sub); font-size: .9rem; font-weight: normal; }

/* ヘッダー */
.site-header { background: #fff; border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--c-text); text-decoration: none; font-weight: bold; line-height: 1.3; }
.brand small { display: block; font-size: .7rem; font-weight: normal; color: var(--c-sub); }
.brand { gap: 6px; }
.brand-mark { width: 52px; height: 52px; flex: none; display: block; }
.brand-logo { height: 62px; width: auto; display: block; }
@media (max-width: 640px) {
  .brand-mark { width: 42px; height: 42px; }
  .brand-logo { height: 50px; }
}
.global-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.global-nav a { color: var(--c-text); text-decoration: none; font-size: .9rem; padding: 6px 12px; border-radius: 999px; }
.global-nav a:hover { background: var(--c-bg); }

/* ヒーロー */
.hero { background: linear-gradient(135deg, var(--c-main-dark), var(--c-main)); color: #fff; }
.hero .container { padding-top: 48px; padding-bottom: 48px; text-align: center; }
.hero h1 { font-size: clamp(1.4rem, 4vw, 2.1rem); margin: 0 0 8px; line-height: 1.4; }
.hero p { margin: 0 0 24px; opacity: .9; }
.search-box { display: flex; max-width: 680px; margin: 0 auto; background: #fff; border-radius: 999px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; padding: 10px 16px; font-size: 1rem; background: transparent; }
.search-box button { border: 0; border-radius: 999px; background: var(--c-accent); color: #fff; font-size: 1rem; font-weight: bold; padding: 10px 24px; cursor: pointer; }
.search-box button:hover { filter: brightness(.95); }
.hero .search-note { font-size: .8rem; margin: 10px 0 0; opacity: .85; }
#search-results:empty { display: none; }
#search-results { margin-top: 32px; }
#search-results .sec-title { font-size: 1.2rem; }

/* セクション */
main.container { padding-bottom: 80px; }
#about { margin-bottom: 24px; }
section { margin-top: 48px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-head h2 { font-size: 1.35rem; margin: 0; }
.more { font-size: .9rem; font-weight: bold; text-decoration: none; }
.note { font-size: .9rem; color: var(--c-sub); }
.panel { background: var(--c-card); border-radius: var(--radius); padding: 8px 24px 24px; box-shadow: var(--shadow); }
h3 { font-size: 1.05rem; margin: 24px 0 8px; }

/* 論文カード */
.paper-list { list-style: none; margin: 0; padding: 0; }
.cards, #search-results .paper-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .cards, #search-results .paper-list { grid-template-columns: minmax(0, 1fr); } }
.paper { background: var(--c-card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; border-top: 4px solid var(--c-main); }
.paper[hidden] { display: none; }
.paper-title { margin: 0; font-weight: bold; line-height: 1.6; }
.paper-title a { color: var(--c-text); text-decoration: none; }
.paper-title a:hover { color: var(--c-main); text-decoration: underline; }
.paper-sub { margin: 4px 0 0; font-size: .9rem; color: var(--c-sub); }
.paper-author { margin: 8px 0 0; font-size: .9rem; color: var(--c-sub); }
.paper-actions { margin-top: auto; padding-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.paper-actions:empty { display: none; }
.pdf-btn { background: var(--c-main); color: #fff; text-decoration: none; font-size: .85rem; font-weight: bold; padding: 6px 14px; border-radius: 999px; }
.pdf-btn:hover { background: var(--c-main-dark); color: #fff; }
.cite-btn { background: #fff; border: 1px solid var(--c-line); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; color: var(--c-text); cursor: pointer; }
.cite-btn:hover { background: var(--c-bg); }
.result-vol { margin: 0 0 4px; font-size: .8rem; }
.result-vol a { color: var(--c-accent); font-weight: bold; text-decoration: none; }
mark { background: #ffe7a3; border-radius: 2px; }

/* 巻号タイル */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { position: relative; background: var(--c-card); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--c-text); box-shadow: var(--shadow); border: 1px solid transparent; display: flex; flex-direction: column; }
.tile:hover { border-color: var(--c-main); }
.tile-year { font-size: .8rem; color: var(--c-sub); }
.tile-vol { font-weight: bold; font-size: .95rem; line-height: 1.5; }
.tile-new { position: absolute; top: 8px; right: 8px; background: var(--c-accent); color: #fff; font-size: .65rem; font-weight: bold; padding: 0 6px; border-radius: 999px; }

/* 号ページ */
.vol-hero { background: linear-gradient(135deg, var(--c-main-dark), var(--c-main)); color: #fff; }
.vol-hero .container { padding-top: 20px; padding-bottom: 32px; }
.vol-hero h1 { margin: 8px 0 12px; font-size: 1.8rem; }
.breadcrumb { font-size: .8rem; opacity: .9; }
.breadcrumb a { color: #fff; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chips li { background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 2px 12px; font-size: .85rem; }
.filter-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; background: var(--c-card); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); margin: -20px 0 24px; position: relative; }
.filter-bar label { font-size: .9rem; font-weight: bold; }
.filter-bar input { flex: 1; min-width: 180px; padding: 8px 12px; font-size: 1rem; border: 1px solid var(--c-line); border-radius: 8px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.btn-ghost { background: #fff; border: 1px solid var(--c-line); border-radius: 999px; padding: 8px 18px; text-decoration: none; font-weight: bold; font-size: .9rem; }

.table-scroll { overflow-x: auto; }
.issn-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .9rem; }
.issn-table th, .issn-table td { border-bottom: 1px solid var(--c-line); padding: 10px 8px; text-align: left; }
.issn-table thead th { color: var(--c-sub); font-weight: normal; font-size: .8rem; }

.site-footer { background: var(--c-text); color: #cfd6dd; font-size: .85rem; }
.site-footer .container { padding-top: 24px; padding-bottom: 24px; }
.site-footer a { color: #fff; }
.site-footer p { margin: 4px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--c-text); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
@media print { .site-header, .hero, .filter-bar, .site-footer, .paper-actions, .pager { display: none; } .paper { box-shadow: none; border: 1px solid #ccc; } }

/* 論文一覧（ホームの最新号・各号ページ・検索結果）：2列表示・小さめの文字 */
.vol-group + .vol-group { margin-top: 32px; }
.vol-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 1.05rem; margin: 0 0 12px; padding-left: 12px; border-left: 4px solid var(--c-accent); }
.vol-head a { color: var(--c-text); text-decoration: none; }
.vol-head a:hover { color: var(--c-main); text-decoration: underline; }
.rows, .cards, #search-results .paper-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .rows, .cards, #search-results .paper-list { grid-template-columns: minmax(0, 1fr); } }
.paper-list .paper { border-top: 0; border-left: 4px solid var(--c-main); padding: 12px 16px; }
.paper-list .paper[hidden] { display: none; }
.paper-list .paper-title { font-size: .9rem; line-height: 1.55; }
.paper-list .paper-sub { font-size: .8rem; margin-top: 2px; }
.paper-list .paper-author { font-size: .8rem; margin-top: 4px; color: var(--c-text); }
.paper-list .paper-actions { padding-top: 10px; gap: 6px; }
.paper-list .pdf-btn, .paper-list .cite-btn { font-size: .75rem; padding: 4px 12px; }

/* 検索エリア：高さを約半分に */
.hero .container { padding-top: 20px; padding-bottom: 22px; }
.hero h1 { font-size: clamp(1.15rem, 3vw, 1.4rem); margin: 0 0 2px; }
.hero p { font-size: .85rem; margin: 0 0 12px; }
.hero p .search-note { display: inline; font-size: .75rem; margin: 0 0 0 8px; opacity: .85; }
.search-box { max-width: 600px; padding: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.search-box input { padding: 6px 14px; font-size: .95rem; }
.search-box button { padding: 6px 20px; font-size: .95rem; }
section#latest { margin-top: 36px; }
@media (max-width: 640px) { .hero p .search-note { display: block; margin: 2px 0 0; } }

/* 最新号の見出し・号見出しを大きく */
#latest .sec-head h2 { font-size: 1.6rem; }
#latest .sec-head h2 .muted { font-size: 1.05rem; margin-left: 4px; }
#latest .vol-head { font-size: 1.3rem; }
#latest .vol-head .muted { font-size: 1rem; }

/* セクション見出し：帯装飾（最新号・巻号一覧・紀要について） */
.sec-head {
  background: linear-gradient(90deg, var(--c-main-dark), var(--c-main));
  color: #fff; border-radius: 8px; padding: 10px 20px;
  border-left: 8px solid var(--c-accent); margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.sec-head h2, #latest .sec-head h2 { font-size: 1.45rem; color: #fff; letter-spacing: .04em; }
.sec-head h2 .muted, #latest .sec-head h2 .muted { color: rgba(255, 255, 255, .85); }
@media (max-width: 640px) {
  .sec-head { padding: 8px 14px; border-left-width: 6px; }
  .sec-head h2, #latest .sec-head h2 { font-size: 1.2rem; }
}

/* 帯装飾：彩度を落としたフォーマル調（濃いスレートグレー＋くすんだ金の線） */
.sec-head {
  background: #3a464c;
  border-radius: 3px;
  border-left: 6px solid #a8956a;
  box-shadow: none;
  padding: 10px 20px;
}
.sec-head h2, #latest .sec-head h2 { font-weight: 600; letter-spacing: .08em; }
.sec-head h2 .muted, #latest .sec-head h2 .muted { color: rgba(255, 255, 255, .75); letter-spacing: .02em; }

/* 帯の縦幅を狭く */
.sec-head { padding: 5px 18px; }
.sec-head h2, #latest .sec-head h2 { line-height: 1.45; }
@media (max-width: 640px) { .sec-head { padding: 4px 12px; } }

/* ===== ヘッダー下の巻号バー（横スクロール） ===== */
.im-a { background: #3a464c; position: sticky; top: 83px; z-index: 4; }
@media (max-width: 640px) { .im-a { position: static; } }
.im-a-inner { display: flex; align-items: center; gap: 8px; padding-top: 6px; padding-bottom: 6px; }
.im-a-label { color: #fff; font-weight: bold; font-size: .85rem; letter-spacing: .1em; padding: 4px 12px 4px 10px; border-left: 4px solid #a8956a; flex: none; }
.im-a-list { list-style: none; margin: 0; padding: 2px 0; display: flex; gap: 6px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; flex: 1; }
.im-a-list::-webkit-scrollbar { display: none; }
.im-a-list a { display: flex; flex-direction: column; align-items: flex-start; white-space: nowrap; color: #fff; text-decoration: none; font-size: .85rem; font-weight: bold; line-height: 1.3; padding: 4px 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,.18); position: relative; }
.im-a-list a:hover { background: rgba(255,255,255,.1); }
.im-a-list a[aria-current="page"] { background: #fff; color: #3a464c; border-color: #fff; }
.im-y { font-size: .7rem; font-weight: normal; opacity: .8; }
.im-new { position: absolute; top: -5px; right: -4px; background: var(--c-accent); color: #fff; font-size: .55rem; padding: 0 4px; border-radius: 999px; }
.im-a-arrow { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.1rem; cursor: pointer; }
.im-a-arrow:hover { background: rgba(255,255,255,.3); }
@media (max-width: 640px) { .im-a-arrow { display: none; } }

/* ページ内リンク（#latest など）で飛んだとき、固定表示のヘッダー＋巻号バーに見出しが隠れないようにする */
#latest, #issues, #about, #search-results { scroll-margin-top: 152px; }
@media (max-width: 640px) { #latest, #issues, #about, #search-results { scroll-margin-top: 128px; } }
