:root {
    --bg: #0f1720;
    --card: #0b1220;
    --text: #e6eef8;
    --muted: #9fb0c8;
    --accent: #6ee7b7;
    --tl-date-width: 72px;
    --max-width: 900px;
    --radius: 12px;
}

* {
    box-sizing: border-box
}

.root-font {
    font-size: 18px
}

body {
    margin: 0;
    font-family: 'Zen Maru Gothic', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
    background: linear-gradient(180deg, #061021 0%, #071427 60%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-size: 18px
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px
}

.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 10px 0
}

.site-header #title {
    font-size: 1.5rem;
    margin: 0
}

.site-header #title a {
    color: var(--text);
    text-decoration: none
}

.site-header #title a:hover {
    text-decoration: underline
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.lang-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer
}

.profile {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px 0
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #7dd3fc);
    color: #052023;
    font-weight: 700;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.avatar:hover {
    transform: scale(1.05);
}

.bio {
    flex: 1
}

.bio h2 {
    margin: 0 0 8px 0
}

.links {
    margin: 12px 0 18px 0;
    padding-left: 18px;
    color: var(--muted)
}

.callout {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 10px;
    color: var(--muted)
}

.meta {
    margin-top: 6px;
    color: var(--muted)
}

.links a {
    color: var(--accent);
    text-decoration: none
}

.links a:hover,
.links a:focus {
    color: var(--text);
    text-decoration: underline
}

.site-footer a {
    color: var(--accent);
    text-decoration: none
}

.site-footer a:hover,
.site-footer a:focus {
    color: var(--text);
    text-decoration: underline
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding: 12px 0;
    margin-top: 24px;
    text-align: center;
    color: var(--muted)
}

.music {
    margin-top: 12px
}

.music h3 {
    margin: 8px 0
}

.embed-wrapper {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6)
}

.embed-wrapper iframe {
    display: block;
    border: 0;
    width: 100%;
    height: 352px
}

.timeline {
    margin-top: 20px
}

.timeline h3 {
    margin: 8px 0
}

.timeline-vertical {
    position: relative;
    padding: 12px 0
}

.timeline-vertical .tl-line {
    position: absolute;
    left: 72px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), rgba(125, 211, 252, 0.6));
    opacity: 0.9
}

.tl-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 12px
}

.tl-date {
    width: 64px;
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 700
}

.tl-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.5);
    max-width: 720px;
    flex: 1;
    min-width: 0
}

.tl-card h4 {
    margin: 0;
    font-size: 1rem
}

.tl-card .desc {
    color: var(--muted);
    margin-top: 6px;
    font-size: 0.95rem
}

.tl-item::before {
    content: '';
    position: absolute;
    left: 66px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(22px);
    box-shadow: 0 0 0 6px rgba(110, 231, 183, 0.06)
}

.github-link {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    transition: transform .12s ease, background .12s ease
}

.github-link svg {
    width: 28px;
    height: 28px;
    fill: var(--text);
    display: block
}

.github-link:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06)
}

.github-link:focus {
    outline: 3px solid rgba(110, 231, 183, 0.9);
    outline-offset: 2px
}

@media (max-width:480px) {
    .github-link {
        top: 12px;
        right: 12px;
        width: 48px;
        height: 48px
    }

    .github-link svg {
        width: 22px;
        height: 22px
    }
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 12px
}

.site-nav a:hover {
    color: var(--text)
}

.blog-list {
    padding-top: 8px
}

.post-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02)
}

.post-item h3 {
    margin: 0;
    font-size: 1.05rem
}

.post-item .meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 6px
}

.post-item .excerpt {
    color: var(--muted);
    margin-top: 8px
}

.tags {
    margin-left: 8px
}

.tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: 999px;
    margin-right: 6px;
    font-size: 0.8rem;
    color: var(--muted)
}

.post-content {
    padding-top: 12px
}

.post-content #post-title {
    font-size: 2rem;
    margin-bottom: 0.5em;
}

.post-content #post-body {
    margin-top: 12px
}

#post-body a {
    color: var(--accent);
    text-decoration: none
}

#post-body a:hover {
    text-decoration: underline
}

.blog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0
}

.lang-switch a {
    color: var(--text);
    text-decoration: none
}

.lang-switch a:hover {
    color: var(--text)
}

.floating-menu {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    top: auto;
    z-index: 99999
}

.fm-toggle {
    background: rgba(110, 231, 183, 0.12);
    border: 1px solid rgba(110, 231, 183, 0.22);
    color: var(--text);
    padding: 14px 28px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(110, 231, 183, 0.10);
    backdrop-filter: blur(6px);
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease
}

.fm-toggle:hover,
.floating-menu .fm-toggle:focus {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 44px rgba(110, 231, 183, 0.18);
    background: rgba(110, 231, 183, 0.16)
}

.fm-toggle:active {
    transform: translateY(-1px) scale(0.995)
}

.fm-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 14px);
    background: rgba(7, 12, 22, 0.88);
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(2, 6, 23, 0.65);
    min-width: 260px;
    border: 1px solid rgba(110, 231, 183, 0.07);
    backdrop-filter: blur(8px)
}

.fm-panel a {
    display: block;
    color: var(--text);
    text-decoration: none;
    padding: 6px 0
}

.fm-panel a:hover {
    color: var(--text)
}

.fm-lang {
    color: var(--muted);
    margin-top: 8px
}

.fm-lang-buttons {
    display: flex;
    gap: 8px;
    margin-top: 6px
}

.fm-lang-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--muted);
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer
}

.fm-lang-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.08)
}

.lang-note {
    color: var(--muted);
    font-size: 0.85rem;
    margin-left: 8px
}

@media (max-width: 640px) {
    .container {
        padding: 12px;
    }

    .site-header #title {
        font-size: 1.25rem
    }

    .profile {
        flex-direction: column;
        align-items: flex-start;
    }

    .avatar {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .embed-wrapper {
        max-width: 100%;
    }

    .floating-menu {
        left: 50%;
        transform: translateX(-50%);
        bottom: 12px;
    }

    .fm-panel {
        min-width: 160px;
    }

    .timeline-vertical .tl-line {
        left: 58px;
    }

    .tl-item {
        gap: 12px;
    }

    .tl-date {
        width: 48px;
        font-size: 0.9rem;
    }

    .tl-item::before {
        left: 52px;
        transform: translateY(18px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fm-toggle {
        transition: none
    }

    .fm-toggle:hover {
        transform: none
    }
}

.site-nav {
    display: none
}

.tl-card h4 a,
.post-item>a {
    color: inherit;
    text-decoration: none;
}

.tl-card h4 a:hover,
.post-item>a:hover {
    color: var(--text);
}

.footer-nav {
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.footer-nav a {
    color: var(--muted);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Tool Grid (Adapted) */
.container>header {
    text-align: center;
    margin-bottom: 2rem;
}

.container>header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

#search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--card);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Tags Filter */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.filter-tag {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--card);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* Tool Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* border-color: var(--accent); Removed glow effect */
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg);
    color: var(--text);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-description {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.5;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.card-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--bg);
    color: var(--muted);
}

.toolbox-container {
    padding-top: 0;
}


/* Domain Tool Styles (Adapted for Dark Theme) */
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

select,
button {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

button {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
}

button:hover {
    opacity: 0.9;
}

/* Specific input overrides for the domain tool */
input[type="text"] {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
}

/* Focus state for inputs */
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1rem;
    font-size: 0.95rem;
}

th,
td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    text-align: right;
}

th {
    background: rgba(255, 255, 255, 0.02);
    text-align: right;
    font-weight: 600;
    color: var(--muted);
}

th:first-child,
td:first-child {
    text-align: left;
}

.status {
    margin: 1rem 0;
    font-weight: 600;
    color: var(--text);
}