:root {
    --primary-color: #2c3e50; /* 自衛隊の制服や規律をイメージした深い紺 */
    --accent-color: #e67e22;  /* 注意を引く、活力を与えるオレンジ */
    --bg-color: #f4f7f6;
    --text-color: #333;
    --surface-color: #ffffff;
    --muted-surface-color: #f9f9f9;
    --nav-bg-color: rgba(0,0,0,0.1);
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

header p {
    margin-top: 0.5rem;
    opacity: 0.9;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.hero-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    border-top: 5px solid var(--accent-color);
}

h2 {
    color: var(--primary-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 10px;
    margin-top: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.guide-card-highlight {
    border-top: 5px solid #4a90e2;
}

.full-width-audio {
    width: 100%;
    margin-top: 0.8rem;
}

.auth-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.auth-note {
    font-size: 0.85rem;
    color: var(--text-muted, #555);
    background: rgba(0, 0, 0, 0.04);
    border-left: 3px solid #aaa;
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    margin-top: 0.8rem;
    line-height: 1.7;
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 1rem;
}

.breadcrumb {
    margin: 1rem 0 0;
    font-size: 0.85rem;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: #888;
}

.breadcrumb li + li::before {
    content: '›';
    margin-right: 0.3rem;
    color: #bbb;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.75;
}

.breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

.breadcrumb li[aria-current='page'] {
    color: #555;
    font-weight: 600;
}

body.jsdf-theme .breadcrumb a {
    color: var(--primary-color);
}

body.jsdf-theme .breadcrumb li[aria-current='page'] {
    color: var(--text-color);
}

.footer {
    background-color: var(--primary-color);
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    margin-top: 3rem;
    font-size: 0.88rem;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 1.05rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.6rem;
    letter-spacing: 0.03em;
}

.footer-tagline {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1.2rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

.footer-nav a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: white;
    text-decoration: underline;
}

.footer-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 0 0 1.2rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
}

body.jsdf-theme .footer {
    background-color: #1f2a1c;
}

.tag {
    display: inline-block;
    background: var(--muted-surface-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

nav {
    background-color: var(--nav-bg-color);
    padding: 1rem;
    text-align: center;
}

.menu-toggle {
    display: none;
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.06);
    color: white;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.14);
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.theme-toggle {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    margin-left: 0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    position: absolute;
    top: 0.9rem;
    right: 1rem;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.12);
}

.theme-toggle.is-active {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.75);
}

.prompt-category {
    background: var(--surface-color);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.prompt-category > h3 {
    color: var(--primary-color);
    border-bottom: 1px solid rgba(44, 62, 80, 0.2);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.prompt-tab-nav {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    padding-right: 2.2rem;
    position: relative;
}

.prompt-tab-nav::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    width: 2rem;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0), var(--bg-color) 72%),
        radial-gradient(circle at 72% 50%, rgba(44, 62, 80, 0.45) 0 18%, rgba(44, 62, 80, 0) 22% 100%);
}

body.jsdf-theme .prompt-tab-nav::after {
    background:
        linear-gradient(to right, rgba(230, 234, 223, 0), var(--bg-color) 72%),
        radial-gradient(circle at 72% 50%, rgba(58, 74, 52, 0.45) 0 18%, rgba(58, 74, 52, 0) 22% 100%);
}

.prompt-tab-nav.is-scrollable:not(.is-scrolled-end)::after {
    opacity: 1;
}

.prompt-tab-btn {
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: var(--surface-color);
    color: var(--primary-color);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.prompt-tab-btn.is-active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.prompt-tab-panel {
    margin-top: 1rem;
}

.prompt-box {
    background: var(--muted-surface-color);
    padding: 1.5rem;
    border-left: 2px solid rgba(44, 62, 80, 0.28);
    margin: 1rem 0;
    border-radius: 4px;
}

.prompt-title {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.prompt-toggle {
    margin: 0;
    padding-right: 1.6rem;
    cursor: pointer;
    position: relative;
    line-height: 1.45;
}

.prompt-toggle::after {
    content: '▾';
    position: absolute;
    right: 0;
    top: 0.05rem;
    transition: transform 0.2s ease;
    color: rgba(44, 62, 80, 0.7);
}

.prompt-box.is-open .prompt-toggle {
    margin-bottom: 0.5rem;
}

.prompt-box.is-open .prompt-toggle::after {
    transform: rotate(180deg);
}

.prompt-toggle:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.prompt-content {
    margin-top: 0;
}

.prompt-text {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    overflow-x: auto;
    line-height: 1.5;
}

.copy-btn {
    display: inline-block;
    background-color: #5cb85c;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 0.5rem;
    cursor: pointer;
    border: none;
}

.copy-btn:hover {
    background-color: #4cae4c;
}

.news-board {
    background: var(--surface-color);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 1rem;
}

.news-board-header {
    border-bottom: 1px solid rgba(44, 62, 80, 0.12);
    padding-bottom: 0.9rem;
    margin-bottom: 0.95rem;
}

.news-board-lead {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.news-chip-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.news-chip {
    display: inline-block;
    border: 1px solid rgba(44, 62, 80, 0.2);
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.2rem 0.62rem;
    background: var(--muted-surface-color);
    color: var(--primary-color);
}

.news-month-group {
    display: grid;
    gap: 0.85rem;
}

.news-month-title {
    margin: 0;
    font-size: 1.04rem;
    color: var(--primary-color);
}

.news-topic-btn {
    border: 1px solid rgba(44, 62, 80, 0.2);
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.2rem 0.62rem;
    background: var(--muted-surface-color);
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 700;
}

.news-topic-btn.is-active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.news-topic-panel {
    display: none;
    gap: 0.8rem;
}

.news-topic-panel.is-active {
    display: grid;
}

.news-item {
    background: var(--surface-color);
    border-left: 4px solid rgba(44, 62, 80, 0.2);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.news-item-highlight {
    border-left-color: var(--accent-color);
}

.news-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.15rem;
}

.news-label {
    font-size: 0.75rem;
    border: 1px solid rgba(44, 62, 80, 0.2);
    border-radius: 999px;
    padding: 0.16rem 0.52rem;
    color: var(--primary-color);
    background: var(--muted-surface-color);
    white-space: nowrap;
}

.news-meta {
    margin: 0;
    font-size: 0.83rem;
    letter-spacing: 0.01em;
    color: #666;
}

.news-collapsible-item {
    padding: 0.8rem 1rem;
}

.news-latest-item {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.news-latest-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.news-badge-latest {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
    margin-top: 0.1rem;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.news-latest-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    flex: 1;
}

.news-latest-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.news-latest-title a:hover {
    text-decoration: underline;
    opacity: 0.75;
}

.news-latest-title a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.news-latest-summary {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #666;
}

.news-latest-date {
    margin: 0 0 0.4rem 0;
    font-size: 0.78rem;
    color: #999;
    letter-spacing: 0.01em;
}

.news-date-label {
    display: inline-block;
    font-size: 0.68rem;
    color: var(--primary-color);
    border: 1px solid currentColor;
    border-radius: 3px;
    padding: 0 0.3rem;
    margin-right: 0.4rem;
    line-height: 1.5;
    vertical-align: middle;
    opacity: 0.8;
}

.news-backnumber-list {
    margin: 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.news-backnumber-list li {
    margin-bottom: 0.5rem;
}

.backnumber-date {
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.01em;
    margin-right: 0.4rem;
}

.news-backnumber-list a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.news-backnumber-list a:hover {
    text-decoration: underline;
    opacity: 0.75;
}

.news-backnumber-list a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.news-entry-toggle {
    margin: 0;
    font-size: 1rem;
    color: var(--primary-color);
    cursor: pointer;
    position: relative;
    padding-right: 1.8rem;
    line-height: 1.45;
}

.news-entry-toggle::after {
    content: '▾';
    position: absolute;
    right: 0;
    top: 0.05rem;
    transition: transform 0.2s ease;
}

.news-collapsible-item.is-open .news-entry-toggle::after {
    transform: rotate(180deg);
}

.news-entry-toggle:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 購読解除セクション */
.unsubscribe-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-color);
}

.unsubscribe-section h4 {
    font-size: 0.95rem;
    margin: 0 0 0.8rem 0;
    color: var(--text-color);
}

.subscribed-emails-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subscribed-email-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.45rem 0.35rem 0.8rem;
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.subscribed-email-text {
    line-height: 1.2;
}

.btn-email-remove {
    border: 0;
    border-radius: 999px;
    background: #e02424;
    color: #fff;
    font-size: 0.72rem;
    padding: 0.18rem 0.48rem;
    cursor: pointer;
    line-height: 1.2;
}

.btn-email-remove:hover {
    opacity: 0.9;
}

.btn-unsubscribe-toggle {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-unsubscribe-toggle:hover {
    background: rgba(var(--primary-color-rgb), 0.05);
}

.unsubscribe-form {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 4px;
}

.unsubscribe-lead {
    font-size: 0.9rem;
    margin: 0 0 0.8rem 0;
    color: #666;
}

.unsubscribe-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.unsubscribe-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.unsubscribe-item input[type="radio"] {
    cursor: pointer;
}

.unsubscribe-item label {
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
}

.btn-cancel {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f0f0f0;
}

.news-entry-content {
    margin-top: 0.7rem;
}

.news-item p:last-child {
    margin-bottom: 0;
}

.news-note {
    font-size: 0.85rem;
    color: #666;
    margin: 0.95rem 0 0;
}

body.jsdf-theme .news-item {
    border-left-color: rgba(58, 74, 52, 0.35);
}
/* NEWS購読フォーム */
.news-subscription-section {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--surface-color);
}

.news-subscription {
    max-width: 600px;
}

.news-subscription h3 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.subscription-lead {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.subscription-form {
    margin-top: 1rem;
}

.form-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#subscriptionEmail {
    flex: 1;
    min-width: 200px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--surface-color);
    border-radius: 4px;
    font-family: inherit;
    transition: all 0.2s ease;
}

#subscriptionEmail:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.btn-subscribe {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-subscribe:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-subscribe:active {
    transform: translateY(0);
}

.subscription-msg {
    margin: 0.8rem 0 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.subscription-msg.success {
    color: #22c55e;
}

.subscription-msg.error {
    color: #ef4444;
}
body.jsdf-theme .news-item-highlight {
    border-left-color: var(--accent-color);
}

body.jsdf-theme .news-board-header {
    border-bottom-color: rgba(58, 74, 52, 0.22);
}

body.jsdf-theme .news-chip,
body.jsdf-theme .news-label,
body.jsdf-theme .news-topic-btn {
    border-color: rgba(58, 74, 52, 0.35);
}

body.jsdf-theme .news-topic-btn.is-active {
    background: var(--primary-color);
    color: #fff;
}

body.jsdf-theme .prompt-category > h3 {
    border-bottom-color: rgba(58, 74, 52, 0.24);
}

body.jsdf-theme .prompt-box {
    border-left-color: rgba(58, 74, 52, 0.35);
}

body.jsdf-theme .prompt-toggle::after {
    color: rgba(58, 74, 52, 0.75);
}

/* 陸上自衛隊風テーマ（利用者切替） */
body.jsdf-theme {
    --primary-color: #3a4a34;
    --accent-color: #8b7a35;
    --bg-color: #e6eadf;
    --text-color: #1f281b;
    --surface-color: #f2f1e8;
    --muted-surface-color: #dce2d1;
    --nav-bg-color: rgba(17, 27, 18, 0.32);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(100, 112, 78, 0.1), transparent 40%),
        radial-gradient(circle at 80% 10%, rgba(59, 72, 52, 0.08), transparent 35%),
        repeating-linear-gradient(
            -25deg,
            rgba(88, 102, 70, 0.05) 0,
            rgba(88, 102, 70, 0.05) 10px,
            rgba(66, 80, 52, 0.02) 10px,
            rgba(66, 80, 52, 0.02) 22px
        );
}

body.jsdf-theme header {
    /* 添付の迷彩画像（img/camouflage.png）を適用 */
    background-color: #2f3d2a;
    background-image:
        linear-gradient(rgba(20, 28, 18, 0.38), rgba(20, 28, 18, 0.38)),
        url('../img/camouflage.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: inset 0 -8px 20px rgba(0, 0, 0, 0.2);
}

body.jsdf-theme .btn {
    background-color: #6f652f;
}

body.jsdf-theme .btn:hover {
    background-color: #5f5628;
}

body.jsdf-theme .tag {
    color: #2a3323;
}

@media (max-width: 768px) {
    header p {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
    }

    .site-nav {
        display: none;
        text-align: left;
        margin-top: 0.9rem;
        padding: 0.85rem;
        border-radius: 8px;
    }

    header.nav-open .site-nav {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .site-nav a {
        margin: 0;
        width: 100%;
    }

    .theme-toggle {
        position: static;
        font-size: 0.78rem;
        padding: 0.28rem 0.62rem;
        margin-top: 0.25rem;
        align-self: flex-end;
        margin-left: auto;
    }

    .prompt-tab-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
    }

    .news-board {
        padding: 1rem;
    }

    .news-item-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }
}

/* スマートフォン専用（国内主要幅 375px〜428px 対応） */
@media (max-width: 428px) {
    header h1 {
        font-size: 1.4rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    .hero-card {
        padding: 1.25rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
