/* --- CSS Variables (共通設定) --- */
:root {
    --primary-color: #0056b3;
    --bg-color: #f4f7f9;
    --panel-bg: #ffffff;
    --input-bg: #ffffff;
    --tool-bg: #eef2f5;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #dddddd;
    --error-color: #dc3545;
    --success-color: #28a745;
    --warning-bg: rgba(255, 193, 7, 0.15);
    --warning-border: rgba(255, 193, 7, 0.5);
    --warning-text: #856404;
    --hover-bg: #f0f0f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --header-height: 60px;
}

[data-theme="dark"] {
    --primary-color: #4da3ff;
    --bg-color: #121212;
    --panel-bg: #1e1e1e;
    --input-bg: #2d2d2d;
    --tool-bg: #252525;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #444444;
    --error-color: #ff6b6b;
    --success-color: #4cd964;
    --warning-bg: rgba(255, 193, 7, 0.1);
    --warning-border: rgba(255, 193, 7, 0.3);
    --warning-text: #ffda6a;
    --hover-bg: #333333;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0; padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

a { text-decoration: none; color: var(--primary-color); }
a:hover { text-decoration: underline; }

/* Header */
header {
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.nav-container {
    max-width: 1000px; margin: 0 auto; padding: 0 20px;
    height: 100%; display: flex; justify-content: space-between; align-items: center;
    position: relative;
}
.logo { font-size: 20px; margin: 0; font-weight: bold; color: var(--text-color); display: flex; align-items: center; gap: 10px; }

.nav-links { display: flex; align-items: center; gap: 20px; margin-left: auto; margin-right: 20px; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary-color); text-decoration: none; }
.nav-links a.current {
    color: var(--primary-color);
    font-weight: bold;
    position: relative;
}
.nav-links a.current::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
#theme-toggle { background: none; border: 1px solid var(--border-color); border-radius: 20px; width: 40px; height: 32px; padding: 0; cursor: pointer; color: var(--text-color); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
#theme-toggle:hover { background-color: var(--hover-bg); }

/* Hamburger */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    color: var(--text-color);
}

/* ---------------------------------------------------- */
/* Breadcrumbs & Layout Adjustments                     */
/* ---------------------------------------------------- */

/* Breadcrumb Style */
.breadcrumb-nav {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 0 10px;
    font-size: 14px;
    color: var(--text-muted);
}
.breadcrumb-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.breadcrumb-nav li { display: flex; align-items: center; }
.breadcrumb-nav li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--border-color);
}
.breadcrumb-nav a { color: var(--text-muted); }
.breadcrumb-nav a:hover { color: var(--primary-color); }
.breadcrumb-nav span { color: var(--text-color); font-weight: bold; }

/* Side Floating Menu */
.side-menu {
    position: fixed;
    left: max(20px, calc(50% - 650px));
    top: 165px; 
    width: 200px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 90;
    overflow: hidden;
}
.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.side-menu li { border-bottom: 1px solid var(--border-color); }
.side-menu li:last-child { border-bottom: none; }
.side-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s;
}
.side-menu a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    text-decoration: none;
}
/* Highlight Current Page */
.side-menu a.current {
    background-color: rgba(0, 86, 179, 0.08);
    color: var(--primary-color);
    font-weight: bold;
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
}
[data-theme="dark"] .side-menu a.current {
    background-color: rgba(77, 163, 255, 0.1);
}

/* ---------------------------------------------------- */

/* Main Content */
.container {
    max-width: 800px; margin: 20px auto 40px;
    background: var(--panel-bg);
    padding: 40px; border-radius: 8px; box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.section-title { 
    margin: 40px 0 20px 0; 
    font-size: 22px; 
    border-left: 5px solid var(--primary-color); 
    padding-left: 15px; 
    color: var(--text-color);
    font-weight: bold;
    line-height: 1.3;
}
.section-title:first-of-type { margin-top: 0; }

p { margin-bottom: 1.5em; font-size: 15px; }

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.feature-card {
    background-color: var(--tool-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
/* Removed .feature-icon style as it's no longer used */

.feature-card h3 { margin: 0 0 10px 0; font-size: 18px; color: var(--text-color); }
.feature-card p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Highlight Box */
.highlight-box {
    background-color: rgba(0, 86, 179, 0.05);
    border: 1px solid rgba(0, 86, 179, 0.2);
    padding: 20px;
    border-radius: 6px;
    margin: 30px 0;
}
[data-theme="dark"] .highlight-box {
    background-color: rgba(77, 163, 255, 0.1);
    border-color: rgba(77, 163, 255, 0.2);
}

/* Operator information */
.info-table {
    width: 100%;
    margin: 24px 0 36px;
    border: 1px solid var(--border-color);
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--panel-bg);
}
.info-table th,
.info-table td {
    padding: 14px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}
.info-table th {
    width: 150px;
    background-color: var(--tool-bg);
    border-right: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.info-table td { font-size: 15px; }
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: none; }

/* Contact */
.contact-box {
    margin: 28px 0 36px;
    padding: 28px;
    text-align: center;
    background: linear-gradient(135deg, var(--tool-bg), var(--panel-bg));
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.contact-label {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.contact-email {
    display: inline-block;
    padding: 11px 22px;
    color: #fff;
    background-color: var(--primary-color);
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    transition: transform 0.2s, box-shadow 0.2s;
}
.contact-email:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.16);
}
.contact-hint {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}
.contact-note {
    padding: 22px 24px;
    background-color: var(--tool-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.contact-note p:last-child { margin-bottom: 0; }

/* Guide list page */
.guide-header { margin-bottom: 40px; text-align: left; }
.guide-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
}
.guide-desc { font-size: 16px; color: var(--text-muted); line-height: 1.6; }
.article-list { display: flex; flex-direction: column; gap: 20px; }
.article-card {
    display: block;
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--tool-bg);
    transition: all 0.2s;
    text-decoration: none;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
    text-decoration: none;
}
.card-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 0 10px 0;
}
.card-desc {
    font-size: 14px;
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}
.tool-cta {
    margin-top: 60px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(0,86,179,0.05) 0%, rgba(0,86,179,0.1) 100%);
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(0,86,179,0.2);
}
.tool-cta-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}
.tool-cta-btn:hover { transform: translateY(-2px); color: #fff; text-decoration: none; }

/* 404 page */
body.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.error-page footer { margin-top: auto; }
.error-container {
    margin: 40px auto;
    padding: 48px 40px;
    text-align: center;
    flex: 1;
}
.error-code {
    font-size: 84px;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
    margin: 0 0 20px 0;
    opacity: 0.8;
}
.error-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-color);
}
.error-desc {
    color: var(--text-muted);
    margin: 0 auto 32px;
    max-width: 560px;
}
.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.error-secondary-btn,
.error-back-btn {
    display: inline-block;
    padding: 13px 24px;
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    background-color: transparent;
    color: var(--primary-color);
    font: inherit;
    font-weight: bold;
    line-height: 1.8;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}
.error-secondary-btn:hover,
.error-back-btn:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-2px);
}
.error-tools {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}
.error-tools h2 {
    margin: 0 0 20px;
    font-size: 19px;
}
.error-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.error-tool-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--tool-bg);
    color: var(--text-color);
    font-size: 14px;
    font-weight: bold;
    transition: border-color 0.2s, transform 0.2s;
}
.error-tool-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-2px);
}

/* Footer */
footer { background-color: var(--tool-bg); border-top: 1px solid var(--border-color); padding: 40px 0 20px; margin-top: 60px; font-size: 14px; }
.footer-content { max-width: 1000px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 20px; font-size: 12px; } 
.footer-links a { color: var(--text-muted); }
.copyright { text-align: center; margin-top: 30px; color: var(--text-muted); font-size: 12px; }

/* Back to top */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background-color: var(--primary-color); color: #fff; border: none; border-radius: 50%;
    cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s ease;
    z-index: 1000; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
#back-to-top.show { opacity: 1; visibility: visible; }

/* Mobile */
@media (max-width: 1200px) {
    .side-menu { display: none; }
    .side-menu { left: 20px; } 
}

@media (max-width: 600px) {
    .container { padding: 20px; margin: 20px auto; }
    .logo { font-size: 18px; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0; right: 0;
        background-color: var(--panel-bg);
        flex-direction: column;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        z-index: 100;
        gap: 0;
        margin: 0;
    }
    .nav-links.active { display: flex; animation: slideDown 0.3s ease; }
    .nav-links a { display: block; width: 100%; text-align: center; padding: 10px 0; font-size: 16px; border-bottom: 1px solid var(--tool-bg); }
    .nav-links a:last-of-type { border-bottom: none; }
    .nav-links a.current::after { display: none; }
    .nav-links a.current {
        background-color: var(--tool-bg);
        border-radius: 4px;
    }
    .hamburger { display: flex; align-items: center; justify-content: center; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
    .breadcrumb-nav { padding: 0 20px; }
    .error-container { padding: 36px 20px; margin: 20px; }
    .error-code { font-size: 68px; }
    .error-actions { flex-direction: column; }
    .error-actions > * { width: 100%; box-sizing: border-box; }
    .error-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-table th { width: 105px; }
    .info-table th,
    .info-table td { padding: 12px; }
    .contact-box { padding: 24px 16px; }
    .contact-email { font-size: 16px; padding: 10px 18px; }
}

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