/* 配色・ヘッダー・見出し・カード・フッターは spa77.works の global.css に合わせる */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    /* 状態色：稼働中は緑、停止は赤、確認不可は黄 */
    --ok: #10b981;
    --ok-bg: #ecfdf5;
    --ok-text: #047857;
    --down: #ef4444;
    --down-bg: #fef2f2;
    --down-text: #b91c1c;
    --warn: #f59e0b;
    --warn-bg: #fffbeb;
    --warn-text: #b45309;
    --wait: #9ca3af;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Yu Gothic', 'Hiragino Kaku Gothic ProN', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.container.narrow {
    max-width: 800px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* ヘッダー */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-sub {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
    cursor: pointer;
    white-space: nowrap;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.btn:disabled:hover {
    background: transparent;
    color: var(--primary-color);
}

/* ページヘッダー */
.page-header {
    padding: 8rem 0 3rem;
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
}

.page-header p {
    color: var(--text-light);
}

/* 全体のまとめ */
.summary {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: left;
}

.summary-text {
    flex: 1;
    min-width: 12em;
}

.summary .summary-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.4;
}

.summary .summary-sub {
    font-size: 0.85rem;
}

[data-checked-at] {
    font-variant-numeric: tabular-nums;
}

.summary[data-state="offline"] .summary-label { color: var(--down-text); }
.summary[data-state="error"] .summary-label { color: var(--warn-text); }

/* 一覧 */
.section {
    padding: 4rem 0 5rem;
    background: var(--bg-light);
}

.group-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.list + .group-title {
    margin-top: 3rem;
}

.list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.row:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.row-main {
    flex: 1;
    min-width: 10em;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.row-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    text-decoration: none;
}

a.row-name[href]:hover {
    color: var(--primary-color);
}

.row-desc {
    font-size: 0.875rem;
    color: var(--text-light);
}

.row-metric {
    font-size: 0.9rem;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 8.5em;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.4;
    background: #f3f4f6;
    color: var(--text-light);
}

[data-state="online"] .badge { background: var(--ok-bg); color: var(--ok-text); }
[data-state="offline"] .badge { background: var(--down-bg); color: var(--down-text); }
[data-state="error"] .badge { background: var(--warn-bg); color: var(--warn-text); }
/* 状態アイコン：data-state に合うものだけ表示する */
.sprite {
    display: none;
}

.state-icon {
    display: inline-flex;
    flex: none;
}

.icon {
    width: 1.1em;
    height: 1.1em;
    display: none;
}

.summary-icon {
    font-size: 2rem;
    color: var(--wait);
}

[data-state="loading"] .icon-loading,
[data-state="online"] .icon-online,
[data-state="offline"] .icon-offline,
[data-state="error"] .icon-error {
    display: block;
}

.summary[data-state="online"] .summary-icon { color: var(--ok); }
.summary[data-state="offline"] .summary-icon { color: var(--down); }
.summary[data-state="error"] .summary-icon { color: var(--warn); }

.note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.note a {
    color: var(--primary-color);
}

/* フッター */
.footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .page-header {
        padding: 7rem 0 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .summary {
        padding: 1.25rem 1.5rem;
    }

    .summary .summary-label {
        font-size: 1.25rem;
    }

    .summary .btn {
        width: 100%;
    }

    .row {
        padding: 1rem 1.25rem;
    }

    .badge {
        min-width: 0;
    }
}
