/* ==========================================
   年齢早見表 - Japanese Aesthetic Design
   和風デザイン (Wafū Design)
   ========================================== */

/* ==========================================
   CSS Variables & Reset
   ========================================== */
:root {
    /* 和色 (Wairo) - Traditional Japanese Colors */
    --sakura: #FADCE9;          /* 桜色 */
    --sakura-dark: #E8A0BF;     /* 桃色 */
    --sakura-deep: #C85A8A;     /* 躑躅色 */
    --indigo: #264478;          /* 藍色 */
    --indigo-light: #3D6098;    /* 縹色 */
    --indigo-pale: #7B9AC5;     /* 勿忘草色 */
    --matcha: #7BA23F;          /* 抹茶色 */
    --matcha-light: #C5E1A5;    /* 若葉色 */
    --vermillion: #E34234;      /* 朱色 */
    --gold: #C9A96E;            /* 金色 */
    --wisteria: #8B6FAE;        /* 藤色 */
    --sumi: #2C2C2C;            /* 墨色 */
    --charcoal: #4A4A4A;        /* 消し炭色 */

    /* Background & Surface */
    --bg-primary: #FAFAF7;      /* 生成り色 (Kinari) - off-white */
    --bg-secondary: #F5F3ED;    /* 鳥の子色 */
    --bg-card: #FFFFFF;
    --bg-warm: #FFF8F0;         /* 薄香色 */
    --bg-accent: #F0EDE5;

    /* Text */
    --text-primary: #2C2C2C;
    --text-secondary: #5C5C5C;
    --text-muted: #8C8C8C;
    --text-accent: #264478;

    /* Borders */
    --border-light: #E8E4DB;
    --border-medium: #D4CFC4;
    --border-accent: #C9A96E;

    /* Shadows - Soft & Subtle */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic Pro', 'Yu Gothic', sans-serif;
    --transition: all 0.25s ease;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 15px;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================
   Particles - Sakura Petals
   ========================================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--sakura);
    border-radius: 50% 0 50% 50%;
    opacity: 0.4;
    animation: sakuraFall linear infinite;
    transform: rotate(45deg);
}

@keyframes sakuraFall {
    0% {
        transform: translate(0, -20px) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    50% {
        transform: translate(-40px, 50vh) rotate(180deg) scale(0.8);
        opacity: 0.3;
    }
    100% {
        transform: translate(30px, 105vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* ==========================================
   Traditional Pattern Background
   ========================================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Subtle asanoha (hemp leaf) pattern */
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M20 0L20 20M0 20L20 20M40 20L20 20M20 40L20 20M0 0L20 20M40 0L20 20M0 40L20 20M40 40L20 20' stroke='%23E8E4DB' stroke-width='0.5' fill='none' opacity='0.4'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* ==========================================
   Header - 和風ヘッダー
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--indigo);
    letter-spacing: 0.5px;
}

.logo-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--indigo);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--indigo);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--sakura-deep);
    border-radius: 2px;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 99;
    flex-direction: column;
    padding: 8px 12px;
}

.mobile-nav.open { display: flex; }

.mobile-nav-link {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--indigo);
    background: var(--bg-secondary);
}

/* ==========================================
   Hero Section - 和風ヒーロー
   ========================================== */
.hero {
    padding: 90px 24px 36px;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    min-height: auto;
    position: relative;
    z-index: 1;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--sakura-deep);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--sumi);
    animation: fadeInUp 0.5s ease 0.1s both;
    letter-spacing: 1px;
}

.gradient-text {
    color: var(--indigo);
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
    animation: fadeInUp 0.5s ease 0.2s both;
    max-width: 600px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--indigo);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--indigo-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--indigo);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--indigo-pale);
    transform: translateY(-1px);
}

/* ==========================================
   Hero Card / Quick Search Widget
   ========================================== */
.hero-visual {
    display: flex;
    justify-content: center;
    width: 100%;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    scroll-margin-top: 70px;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sakura-deep), var(--indigo), var(--matcha));
}

.hero-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    gap: 6px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.card-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.card-dot.red { background: #E8A0BF; }
.card-dot.yellow { background: var(--gold); }
.card-dot.green { background: var(--matcha); }

.card-body {
    padding: 16px 32px 14px;
}

/* Widget Title */
.widget-title {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 6px;
    margin-bottom: 2px !important;
    color: var(--indigo);
    font-size: 1.05rem;
    font-weight: 700;
}

.widget-label {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px !important;
    font-weight: 500;
}

/* Widget Search Row - Desktop & Mobile: horizontal */
.widget-search-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    width: 100%;
}

.widget-input {
    flex: 1; /* or width: 75% */
    width: 75%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: var(--font-family);
    transition: var(--transition);
    outline: none;
}

.widget-input:focus {
    border-color: var(--indigo-pale);
    box-shadow: 0 0 0 3px rgba(38, 68, 120, 0.08);
}

.widget-input::placeholder {
    color: var(--text-muted);
}

.widget-input.input-error {
    border-color: var(--vermillion);
    animation: shake 0.4s ease;
}

.widget-btn {
    width: 25%;
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Widget Results */
.widget-results {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.widget-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.widget-result-item {
    text-align: center;
    padding: 8px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.widget-result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.widget-result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.widget-result-age {
    font-size: 1.4rem;
    color: var(--sakura-deep);
}

/* Zodiac (Eto) - prevent text overflow */
.widget-result-eto-value {
    white-space: nowrap;
    word-break: keep-all;
}

.widget-result-note {
    font-size: 0.75rem;
    color: var(--vermillion);
    text-align: center;
    margin-bottom: 8px;
}

.widget-result-animate {
    animation: fadeInUp 0.35s ease;
}

/* Widget Action Buttons */
.widget-action-btns {
    display: flex;
    gap: 8px;
}

.widget-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    background-color: #f0f4f8;
    color: var(--indigo);
    border: 1px solid #adc6e5;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.widget-action-btn:hover {
    background-color: #e6effa;
    border-color: #92b3d9;
    transform: translateY(-1px);
}

.widget-ctr-btn {
    text-decoration: none;
    color: #2b437e;
    border-color: #2b437e;
    background-color: #f0f3f9;
    position: relative;
    overflow: hidden;
}

.widget-ctr-btn:hover {
    background-color: #e2e8f4;
    border-color: #1a2d5e;
    color: #1a2d5e;
    transform: translateY(-1px);
}

.widget-ctr-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    animation: shineEffect 3s infinite;
}

@keyframes shineEffect {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Share Buttons — X / LINE / はてなブックマーク
   ========================================== */
.share-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 0.9;
}

.share-btn.share-x { background: #000000; }
.share-btn.share-line { background: #06C755; }
.share-btn.share-hatena { background: #00A4DE; }


/* Table Notice Box */
.table-notice-box {
    font-size: 12px;
    color: #c56294; /* Match dl-btn pink */
    text-align: center;
    margin: 15px 0;
}

.year-link {
    color: #0b1f4a; /* Navy blue */
    text-decoration: underline;
    font-weight: 500;
    display: block;
    padding: 8px 0; /* Make touch target larger */
    margin: -8px 0; /* Offset padding visually */
    transition: color 0.2s ease;
}

.year-link:hover {
    color: #d4af37; /* Highlight color on hover */
}

/* ==========================================
   Table Section - 早見表
   ========================================== */
.table-section {
    padding: 50px 0;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--sumi);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
    position: relative;
}

/* Tooltip inside section title */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tooltip-icon {
    font-size: 1.2rem;
    color: var(--gold);
    transition: var(--transition);
}

.tooltip-wrapper:hover .tooltip-icon {
    color: var(--sakura-deep);
    transform: scale(1.1);
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    width: max-content;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 10;
    text-align: left;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--bg-card) transparent transparent transparent;
}

.tooltip-content::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px;
    border-style: solid;
    border-color: var(--border-medium) transparent transparent transparent;
    z-index: -1;
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip-list li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 6px 0;
    border-bottom: 1px solid rgba(240, 220, 200, 0.5);
    font-weight: 400;
}

.tooltip-list li:last-child {
    border-bottom: none;
}

.tooltip-list li strong {
    color: var(--vermillion);
    font-weight: 600;
}

.title-icon {
    font-size: 1.3rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-year-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--sakura);
    border: 1px solid var(--sakura-dark);
    border-radius: 100px;
}

.table-year-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sakura-deep);
}

/* Table Inline Search */
.table-inline-search {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    overflow: hidden;
    background: white;
    transition: var(--transition);
}

.table-inline-search:focus-within {
    border-color: var(--indigo-pale);
    box-shadow: 0 0 0 3px rgba(38, 68, 120, 0.08);
}

.table-search-input {
    border: none;
    outline: none;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-family: var(--font-family);
    background: transparent;
    color: var(--text-primary);
    width: 110px;
    -moz-appearance: textfield;
}

.table-search-input::-webkit-outer-spin-button,
.table-search-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.table-search-input::placeholder {
    color: var(--text-muted);
}

.table-search-input.input-error {
    animation: shake 0.4s ease;
}

.table-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    background: var(--indigo);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.table-search-btn:hover {
    background: var(--indigo-light);
}

.table-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.table-filter::-webkit-scrollbar {
    height: 0px; /* Hide scrollbar by default for clean look, user can still swipe */
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    background: white;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.filter-btn:hover {
    border-color: var(--indigo-pale);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.filter-btn.active {
    background: var(--indigo);
    border-color: var(--indigo);
    color: white;
}

.dl-btn {
    background: #c56294 !important;
    border-color: #c56294 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(197, 98, 148, 0.2);
}

.dl-btn:hover {
    background: #b35282 !important;
    border-color: #b35282 !important;
    box-shadow: 0 4px 8px rgba(179, 82, 130, 0.3);
}

/* Quick year links — internal link hub trong bài SEO trang chủ */
.quick-year-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 20px;
}

.quick-year-links a {
    padding: 6px 16px;
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.quick-year-links a:hover {
    border-color: var(--indigo-pale);
    background: var(--bg-secondary);
    color: var(--indigo);
}

@media (min-width: 992px) {
    .table-search-input {
        width: 320px;
        padding: 9px 18px;
        font-size: 0.9rem;
    }
}

/* Single Table (replaces dual-table) */
.single-table {
    width: 100%;
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #2b437e;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--indigo);
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.school-table-wrapper {
    overflow: visible;
}

.school-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: visible !important;
    overflow-y: visible !important;
    box-shadow: var(--shadow-md);
}

.table-scroll {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.highlight-row {
    background-color: #fff3cd !important;
    transition: background-color 0.5s ease;
}

.age-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.age-table thead {
    /* No sticky here, we do it on TH */
}

.age-table th {
    position: sticky !important;
    top: 0;
    z-index: 5;
    padding: 12px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: white;
    background: #2b437e !important;
    text-align: center;
    border-bottom: 1px solid #1a252f;
}

.age-table td {
    padding: 9px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    transition: var(--transition);
}

.age-table tbody tr {
    transition: var(--transition);
}

.age-table tbody tr:hover {
    background: #FFF5F8;
}

/* Era-specific left border colors */
.era-reiwa td:first-child {
    border-left: 3px solid var(--sakura-deep);
}

.era-heisei td:first-child {
    border-left: 3px solid var(--indigo-pale);
}

.era-showa td:first-child {
    border-left: 3px solid var(--matcha);
}

.era-taisho td:first-child {
    border-left: 3px solid var(--gold);
}

/* Zebra striping */
.age-table tbody tr:nth-child(even) {
    background: var(--bg-primary);
}

.age-table tbody tr:nth-child(even):hover {
    background: #FFF5F8;
}

/* Eto column - prevent overflow */
.td-eto {
    white-space: nowrap;
    word-break: keep-all;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

/* Age badge */
.age-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.85rem;
    background: #F5F0FF;
    color: var(--indigo);
}

.row-highlight .age-badge {
    background: var(--indigo);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Row animation */
.row-animate {
    animation: fadeInRow 0.3s ease both;
}

@keyframes fadeInRow {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.row-flash {
    animation: flashRow 2.5s ease;
}

.row-flash-yellow {
    animation: flashYellow 2.5s ease;
}

@keyframes flashYellow {
    0%, 100% { background: transparent; }
    15% { background: #fff3cd; transform: scale(1.01); }
    30% { background: transparent; }
    45% { background: #fff3cd; transform: scale(1.01); }
    100% { background: transparent; }
}

@keyframes flashRow {
    0%, 100% { background: transparent; }
    10% { background: #FADCE9; transform: scale(1.01); }
    20% { background: transparent; }
    30% { background: #FADCE9; transform: scale(1.01); }
    40% { background: transparent; }
    50% { background: #FADCE9; transform: scale(1.01); }
    65% { background: rgba(250, 220, 233, 0.5); }
    100% { background: transparent; }
}

.td-wareki {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.td-year {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================
   Feature Section - Horizontal Card Layout
   ========================================== */
.feature-section {
    padding: 30px 0 60px;
    position: relative;
    z-index: 1;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.feature-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    border-color: var(--sakura-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--sakura), var(--sakura-deep));
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 2.8rem;
    flex-shrink: 0;
    line-height: 1;
}

.feature-text {
    flex: 1;
    min-width: 0;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.feature-arrow {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: auto;
}

.feature-card:hover .feature-arrow {
    color: var(--sakura-deep);
    transform: translateX(6px);
}

/* ==========================================
   Footer - フッター
   ========================================== */
.footer {
    padding: 50px 0 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 36px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--indigo);
    margin-bottom: 10px;
}

.footer-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.footer-links a {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 4px 0;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--indigo);
    transform: translateX(3px);
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding: 16px 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================
   Responsive - 1024px
   ========================================== */
@media (max-width: 1024px) {
    .hero {
        padding: 86px 24px 32px;
        gap: 16px;
        min-height: auto;
    }

    .hero-title { font-size: 2.2rem; }
}

/* ==========================================
   Responsive - 768px (Tablet / Mobile)
   ========================================== */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .hero {
        padding: 96px 16px 40px;
    }

    .hero-title { font-size: 2.2rem; }
    .hero-desc { font-size: 0.88rem; }

    .hero-card {
        width: 100%;
        max-width: 100%;
    }

    /* Keep Widget input horizontal on mobile, but reduce padding slightly */
    .widget-input {
        padding: 10px 10px;
        font-size: 0.95rem;
    }

    .widget-btn {
        padding: 10px 10px;
        font-size: 0.88rem;
        min-height: 40px;
    }

    /* Widget result grid stays 2x2 */
    .widget-result-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Eto text: smaller font to prevent overflow */
    .widget-result-eto-value {
        font-size: 0.85rem;
    }

    .widget-result-item {
        padding: 6px 6px;
    }

    /* Widget action buttons: stack if too narrow */
    .widget-action-btns {
        flex-direction: column;
        gap: 6px;
    }

    .widget-action-btn {
        min-height: 38px;
    }

    /* Container padding */
    .container {
        padding: 0 16px;
    }

    /* Table controls: stack */
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .table-controls-left {
        flex-direction: column;
        align-items: stretch;
    }

    .table-year-badge {
        align-self: flex-start;
    }

    .table-inline-search {
        width: 100%;
    }

    .table-search-input {
        width: 100%;
        flex: 1;
    }

    .table-filter {
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.78rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .section-title { font-size: 1.25rem; }
    .section-subtitle { font-size: 0.82rem; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
    .footer-brand { grid-column: 1 / -1; }

    /* Feature cards */
    .feature-card {
        padding: 18px 16px;
    }

    .feature-icon {
        font-size: 2.2rem;
    }

    .feature-card h3 {
        font-size: 0.92rem;
    }

    .feature-card p {
        font-size: 0.78rem;
    }


    .age-table td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .age-table th {
        padding: 10px 10px;
        font-size: 0.74rem;
    }

    .school-table td,
    .school-table th {
        padding: 8px 8px;
        white-space: nowrap;
    }

    .td-eto {
        font-size: 0.78rem;
    }

    .eto-table-new {
        table-layout: fixed;
        width: 100%;
    }

    .eto-table-new th,
    .eto-table-new td {
        white-space: nowrap;
        padding: 12px 14px;
    }

    /* Column widths tuned so first 4 columns remain visible on small screens */
    .eto-table-new th:nth-child(1),
    .eto-table-new td:nth-child(1) { width: 20%; min-width: 60px; }
    .eto-table-new th:nth-child(2),
    .eto-table-new td:nth-child(2) { width: 22%; min-width: 72px; }
    .eto-table-new th:nth-child(3),
    .eto-table-new td:nth-child(3) { width: 20%; min-width: 68px; }
    .eto-table-new th:nth-child(4),
    .eto-table-new td:nth-child(4) { width: 15%; min-width: 48px; }
    .eto-table-new th:nth-child(5),
    .eto-table-new td:nth-child(5) { width: 23%; min-width: 72px; }

    .age-badge {
        padding: 2px 10px;
        font-size: 0.8rem;
    }
}

/* ==========================================
   Responsive - 480px (Small Mobile)
   ========================================== */
@media (max-width: 480px) {
    .hero {
        padding-top: 88px;
        padding-bottom: 36px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-title { font-size: 1.8rem; }

    .card-body {
        padding: 14px 14px 10px;
    }

    .widget-title {
        font-size: 0.85rem;
    }

    .widget-result-grid {
        gap: 5px;
    }

    .widget-result-item {
        padding: 5px 4px;
    }

    .widget-result-value {
        font-size: 0.8rem;
    }

    .widget-result-age {
        font-size: 1rem;
    }

    .widget-result-eto-value {
        font-size: 0.72rem;
    }

    .widget-action-btn {
        font-size: 0.74rem;
        padding: 7px 6px;
        min-height: 36px;
    }

    /* Reduce horizontal padding further on very small screens so the search row fits */
    .widget-search-row {
        gap: 8px;
    }
    
    .widget-input {
        padding: 8px 8px;
        font-size: 0.9rem;
    }
    
    .widget-btn {
        padding: 8px 6px;
        font-size: 0.82rem;
    }

    .age-table td {
        padding: 7px 6px;
        font-size: 0.76rem;
    }

    .age-table th {
        padding: 9px 6px;
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    .td-eto {
        font-size: 0.72rem;
    }

    .age-badge {
        padding: 2px 8px;
        font-size: 0.76rem;
    }

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

    .feature-card {
        padding: 16px 14px;
        gap: 14px;
    }

    .feature-icon {
        font-size: 2rem;
    }


    .filter-btn {
        padding: 7px 10px;
        font-size: 0.72rem;
        min-height: 44px;
    }

    .table-search-input {
        font-size: 0.78rem;
        padding: 7px 10px;
    }
}

/* ==========================================
   SEO Article Section - 年齢早見表とは？
   ========================================== */
.seo-section {
    position: relative;
    z-index: 1;
    padding: 56px 24px;
}

.seo-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Typography inside SEO section */
.seo-section p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.seo-section p:last-child {
    margin-bottom: 0;
}

.seo-section a {
    color: var(--indigo);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.seo-section a:hover {
    text-decoration: underline;
    color: var(--indigo-light);
}

.seo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2b437e;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--sakura);
    letter-spacing: 0.5px;
}

.seo-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2b437e;
    margin-top: 32px;
    margin-bottom: 16px;
    padding-left: 14px;
    border-left: 3px solid var(--sakura-deep);
}

/* Visible intro section */
.seo-content-visible {
    margin-bottom: 8px;
}

/* Toggle button wrapper */
.seo-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.seo-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: #2b437e;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(43, 67, 126, 0.2);
}

.seo-toggle-btn:hover {
    background: #3d5a9e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 67, 126, 0.3);
}

.seo-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(43, 67, 126, 0.15);
}

.seo-btn-icon {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.seo-toggle-btn[aria-expanded="true"] .seo-btn-icon {
    transform: rotate(180deg);
}

/* Hidden content - default state */
.seo-content-more {
    display: none;
    opacity: 0;
    padding-top: 8px;
}

.seo-content-more.expanded {
    display: block;
    animation: seoFadeIn 0.4s ease forwards;
}

@keyframes seoFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Formula box */
.seo-formula {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    margin: 16px 0 20px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--indigo);
    letter-spacing: 2px;
    box-shadow: var(--shadow-sm);
}

.seo-formula span {
    color: var(--sakura-deep);
    font-weight: 700;
}

/* Lists */
.seo-list {
    list-style: disc;
    padding-left: 28px;
    margin: 12px 0 16px;
}

.seo-list li {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding-left: 4px;
}

.seo-list li::marker {
    color: var(--sakura-deep);
}

/* FAQ section */
.seo-faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--indigo-pale);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-size: 14px;
    font-weight: 700;
    color: #2b437e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-question::before {
    content: 'Q.';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--sakura);
    color: var(--sakura-deep);
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 800;
}

.faq-answer {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    padding-left: 36px;
    margin-bottom: 0;
}

/* SEO Section Responsive */
@media (max-width: 768px) {
    .seo-section {
        padding: 40px 16px;
    }

    .seo-title {
        font-size: 1.3rem;
    }

    .seo-subtitle {
        font-size: 1.1rem;
        margin-top: 28px;
    }

    .seo-toggle-btn {
        padding: 11px 28px;
        font-size: 0.88rem;
    }

    .faq-item {
        padding: 16px 18px;
    }

    .faq-answer {
        padding-left: 0;
    }

    .seo-formula {
        font-size: 1rem;
        padding: 14px 18px;
        letter-spacing: 1px;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .header, .hero,
    .feature-section, .footer,
    .particles, .table-controls, .mobile-nav,
    .seo-section {
        display: none !important;
    }

    body { background: white; }
    body::before { display: none; }

    .table-section { padding: 0; }

    .table-container {
        background: white;
        border: 1px solid #ccc;
        margin-bottom: 16px;
        box-shadow: none;
        break-inside: avoid;
    }

    .age-table th {
        background: #f0f0f0;
        color: #333;
    }

    .age-table td { color: #333; border-bottom: 1px solid #eee; }
    .age-badge { background: transparent; color: #333; }
    .row-highlight .age-badge { background: #eee; color: #333; box-shadow: none; }

    .era-reiwa td:first-child, .era-heisei td:first-child,
    .era-showa td:first-child, .era-taisho td:first-child {
        border-left: 3px solid #999;
    }

    .section-header { opacity: 1; transform: none; }
    .section-title { color: #333; }
}
