:root {
    --primary: #0f766e;
    --primary-strong: #115e59;
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-muted: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 35px rgba(15, 23, 42, 0.14);
    --code-bg: #eef2ff;
    --code-text: #1e293b;
    --pre-bg: #0f172a;
    --pre-text: #e2e8f0;
    --info-bg: #dbeafe;
}

body.dark,
html.dark body {
    --primary: #2dd4bf;
    --primary-strong: #5eead4;
    --bg-page: #020617;
    --bg-surface: #0f172a;
    --bg-muted: #1e293b;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 40px rgba(0, 0, 0, 0.5);
    --code-bg: #020617;
    --code-text: #e2e8f0;
    --pre-bg: #020617;
    --pre-text: #cbd5e1;
    --info-bg: #082f49;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: rgba(15, 118, 110, 0.15);
    transition: background-color 0.25s ease, color 0.25s ease;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
}

a {
    color: inherit;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 导航栏 */
.navbar {
    height: 70px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

body.dark .navbar,
html.dark .navbar {
    background: rgba(2, 6, 23, 0.86);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 24px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

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

.nav-auth-status {
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
}

.nav-auth-status a {
    margin-left: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    line-height: 1.2;
    color: var(--text-main);
    background: var(--bg-surface);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-auth-status a:hover,
.nav-auth-status a:focus-visible {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-muted);
}

/* Hero 区域 */
.hero {
    padding: 86px 0 70px;
    text-align: center;
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.11) 0%, rgba(15, 118, 110, 0) 65%);
}

body.dark .hero,
html.dark .hero {
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.18) 0%, rgba(2, 6, 23, 0) 70%);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.08rem;
}

.hero-cta {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    border: 1px solid transparent;
    -webkit-appearance: none;
    appearance: none;
    color: #ffffff;
    background: var(--primary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
    background: var(--primary-strong);
    transform: translateY(-1px);
}

/* 首页布局 */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(220px, 1fr);
    gap: 30px;
    align-items: start;
}

.blog-content {
    min-width: 0;
}

.blog-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    margin: 28px 0 8px;
}

.post-search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    color: var(--text-main);
}

.post-search-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.post-tool-btn {
    white-space: nowrap;
}

.post-filter-status {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 36px 0 24px;
}

.loading-text,
.empty-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 24px 0;
}

.card {
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.card-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 16px;
}

.card-img {
    height: 190px;
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: 22px;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(15, 118, 110, 0.12);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 0.08em;
}

body.dark .card-tag,
html.dark .card-tag {
    background: rgba(45, 212, 191, 0.2);
}

.card-content h3 {
    margin: 10px 0;
    font-size: 1.24rem;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* 侧边栏 */
.sidebar-simple {
    position: sticky;
    top: 88px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.nav-group + .nav-group {
    margin-top: 22px;
}

.nav-group h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.nav-group a {
    display: block;
    padding: 8px 10px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-group a:last-child {
    margin-bottom: 0;
}

.nav-group a:hover,
.nav-group a:focus-visible {
    background: var(--bg-muted);
    color: var(--primary);
}

.nav-group .category-link.is-active {
    background: var(--bg-muted);
    color: var(--primary);
    font-weight: 700;
}

.about-section {
    margin: 6px 0 60px;
    padding: 26px;
    border-radius: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.about-section h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.about-section p {
    color: var(--text-muted);
}

/* 账号页 */
.auth-main {
    padding-top: 36px;
    padding-bottom: 56px;
}

.auth-status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.auth-status-card h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.status-meta {
    color: var(--text-muted);
}

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.auth-card-single {
    max-width: 560px;
    margin: 0 auto;
}

.auth-card-single h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.auth-card h2 {
    margin-bottom: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form label {
    font-weight: 600;
    font-size: 0.92rem;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-page);
    color: var(--text-main);
}

.auth-form input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 600;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-link:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    text-decoration: none;
}

.btn-link:hover,
.btn-link:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.auth-message {
    min-height: 1.5em;
    margin-top: 10px;
    font-size: 0.92rem;
}

.auth-message.is-error {
    color: #dc2626;
}

.auth-message.is-success {
    color: #059669;
}

.auth-message.is-muted {
    color: var(--text-muted);
}

.auth-inline-links {
    margin-top: 10px;
    color: var(--text-muted);
}

.is-hidden {
    display: none !important;
}

/* 独立信息页 */
.page-main {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    padding-top: 28px;
    padding-bottom: 28px;
}

.info-card {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.info-kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 12px;
}

.info-card h1 {
    font-size: 2rem;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.info-card p {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.info-actions {
    margin-top: 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover,
.text-link:focus-visible {
    text-decoration: underline;
}

/* 工具页 */
.tools-main {
    padding-top: 36px;
    padding-bottom: 56px;
    min-width: 0;
}

.tools-header {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    width: 100%;
    min-width: 0;
}

.tools-kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 10px;
}

.tools-header h1 {
    font-size: 1.9rem;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.tools-header p {
    color: var(--text-muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    min-width: 0;
}

.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-width: 0;
}

.tool-card h2 {
    font-size: 1.14rem;
    margin-bottom: 8px;
}

.tool-desc {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tool-form {
    display: grid;
    gap: 9px;
}

.tool-form-split {
    margin-bottom: 10px;
}

.tool-field {
    display: grid;
    gap: 6px;
}

.tool-field label {
    font-weight: 600;
    font-size: 0.9rem;
}

.tool-field input {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-page);
    color: var(--text-main);
}

.tool-field input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.tool-actions {
    margin-top: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-message {
    min-height: 1.4em;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tool-message.is-error {
    color: #dc2626;
}

.tool-message.is-success {
    color: #059669;
}

.tool-result {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-muted);
    padding: 12px;
}

.tool-result p {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tool-result p:last-child {
    margin-bottom: 0;
}

.tool-result strong {
    color: var(--text-main);
    font-weight: 700;
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tool-hint {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.83rem;
}

.tool-output-list {
    margin: 8px 0 0;
    padding-left: 20px;
    color: var(--text-main);
}

.tool-output-list li {
    margin-bottom: 6px;
    word-break: break-all;
}

.tool-table-wrap {
    margin-top: 10px;
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.tool-table th,
.tool-table td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.86rem;
    color: var(--text-muted);
}

.tool-table th {
    color: var(--text-main);
    background: var(--bg-muted);
    font-weight: 700;
}

.tool-table td {
    word-break: break-word;
}

.port-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.port-open {
    background: #d1fae5;
    color: #065f46;
}

.port-closed {
    background: #fee2e2;
    color: #991b1b;
}

.ping-chart-wrap {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: var(--bg-muted);
    max-width: 100%;
    overflow: hidden;
}

.ping-canvas {
    width: 100%;
    max-width: 100%;
    height: 220px;
    display: block;
}

.tool-raw-wrap {
    margin-top: 10px;
}

.tool-raw-wrap summary {
    cursor: pointer;
    color: var(--text-main);
    font-weight: 600;
}

.tool-raw {
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-muted);
    color: var(--text-main);
    font-size: 0.8rem;
    line-height: 1.45;
}

/* 管理员页 */
.admin-main {
    padding-top: 36px;
    padding-bottom: 56px;
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.admin-card h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.admin-meta {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.admin-message {
    min-height: 1.4em;
    margin-bottom: 14px;
}

.admin-message.is-error {
    color: #dc2626;
}

.admin-message.is-success {
    color: #059669;
}

.admin-message.is-muted {
    color: var(--text-muted);
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.admin-table th {
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-muted);
}

.admin-table td {
    color: var(--text-muted);
}

.admin-table tbody tr:hover {
    background: var(--bg-muted);
}

.submission-form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.submission-form label {
    font-weight: 600;
    font-size: 0.92rem;
}

.submission-form input,
.submission-form textarea,
.submission-form select,
.inline-select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: inherit;
}

.submission-form textarea {
    resize: vertical;
    min-height: 90px;
}

.submission-form input:focus-visible,
.submission-form textarea:focus-visible,
.submission-form select:focus-visible,
.inline-select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.inline-label {
    align-self: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.inline-select {
    width: auto;
    min-width: 140px;
    padding: 8px 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-tiny {
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-approve {
    background: #10b981;
    color: #ffffff;
}

.btn-reject {
    background: #ef4444;
    color: #ffffff;
}

.btn-tiny:hover {
    opacity: 0.9;
}

.table-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 评论区 */
.comments-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.comments-section h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
}

.comments-meta {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.comment-form {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
}

.comment-form textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.comments-message {
    min-height: 1.4em;
    margin-bottom: 10px;
}

.comments-message.is-error {
    color: #dc2626;
}

.comments-message.is-success {
    color: #059669;
}

.comments-message.is-muted {
    color: var(--text-muted);
}

.comment-list {
    display: grid;
    gap: 10px;
}

.comment-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-surface);
    padding: 12px;
}

.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.comment-item p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 46px 0 56px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 文章页专用样式 */
.post-page {
    background: var(--bg-page);
}

.back-btn {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}

.post-header {
    text-align: center;
    margin-bottom: 50px;
}

.post-header h1 {
    font-size: 2.5rem;
    margin: 15px 0;
    letter-spacing: -0.03em;
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    gap: 20px;
    display: flex;
    justify-content: center;
}

.read-time-meta {
    font-weight: 600;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-main);
}

.post-content p {
    margin-bottom: 25px;
}

.post-content h2 {
    margin: 30px 0 15px;
    font-size: 1.4rem;
}

.post-content ul {
    margin: 0 0 24px 20px;
}

.post-content li {
    margin-bottom: 10px;
    color: var(--text-main);
}

.post-content img {
    width: 100%;
    border-radius: 16px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-right: 18px;
    -webkit-appearance: none;
    appearance: none;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    font-style: normal;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.reading-progress {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 140;
    background: transparent;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-strong) 100%);
    transition: width 0.1s linear;
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 120;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(12deg);
}

.theme-toggle:active {
    transform: scale(0.96);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.blink {
    animation: blink-animation 1s steps(2, start) infinite;
    color: #00ff00;
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

.terminal-style {
    background: #2d2d2d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Courier New", monospace;
    font-weight: bold;
    color: #fff;
}

/* 响应式 */
body.easter-egg-open {
    overflow: hidden;
}
.easter-egg-hotspot {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: 24px;
    height: 24px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 999px;
    background: radial-gradient(circle at 34% 32%, rgba(255, 255, 255, 0.9) 0 1px, rgba(15, 118, 110, 0.34) 46%, rgba(15, 118, 110, 0) 72%);
    color: transparent;
    opacity: 0.26;
    cursor: pointer;
    z-index: 119;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.easter-egg-hotspot::before {
    content: "\2726";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 12px;
    line-height: 1;
    opacity: 0.82;
    animation: easter-egg-twinkle 3s ease-in-out infinite;
    pointer-events: none;
}
.easter-egg-hotspot:hover,
.easter-egg-hotspot:focus-visible {
    opacity: 0.92;
    transform: scale(1.08);
    border-color: rgba(15, 118, 110, 0.5);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    outline: none;
}
.easter-egg-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(11, 18, 32, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    z-index: 180;
}
.easter-egg-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.easter-egg-card {
    position: relative;
    width: min(560px, 100%);
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-page) 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    padding: 22px 20px 18px;
    transform: translateY(8px) scale(0.985);
    transition: transform 0.22s ease;
}
.easter-egg-overlay.is-visible .easter-egg-card {
    transform: translateY(0) scale(1);
}
.easter-egg-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-page);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.easter-egg-close:hover,
.easter-egg-close:focus-visible {
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
    outline: none;
}
.easter-egg-kicker {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}
.easter-egg-card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    line-height: 1.25;
}
.easter-egg-message {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.65;
    min-height: 3.1em;
}
.easter-egg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.easter-egg-meta-item {
    border: 1px solid var(--border);
    background: var(--bg-page);
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
}
.easter-egg-label {
    color: var(--text-muted);
    font-size: 0.78rem;
}
.easter-egg-meta-item strong {
    color: var(--text-main);
    font-size: 0.95rem;
    word-break: break-word;
}
.easter-egg-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.easter-egg-actions .btn-primary,
.easter-egg-actions .btn-secondary {
    min-height: 40px;
}

@keyframes easter-egg-twinkle {
    0%,
    100% {
        opacity: 0.34;
        transform: scale(0.9);
    }

    12% {
        opacity: 0.95;
        transform: scale(1.08);
    }

    24% {
        opacity: 0.44;
        transform: scale(0.96);
    }

    60% {
        opacity: 0.7;
        transform: scale(1);
    }
}
@media (max-width: 960px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-simple {
        position: static;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .navbar {
        min-height: 70px;
        height: auto;
    }

    .navbar .container {
        padding: 12px 16px;
        gap: 8px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .nav-links a {
        margin-left: 14px;
        font-size: 0.9rem;
    }

    .hero {
        padding: 70px 0 52px;
    }

    .hero h1 {
        font-size: 2.1rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .post-header h1 {
        font-size: 1.85rem;
    }

    .tools-header h1 {
        font-size: 1.7rem;
    }

    .blog-tools {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .blog-tools .post-search-input {
        grid-column: 1 / -1;
    }

    .auth-actions {
        gap: 12px;
    }

    .auth-actions .btn-link,
    .auth-actions .btn-secondary,
    .auth-actions .btn-danger {
        min-height: 42px;
    }
}

@media (max-width: 560px) {
    .navbar .container {
        flex-wrap: wrap;
        align-items: center;
    }

    .theme-toggle {
        margin-right: 8px;
    }

    .logo {
        margin-right: auto;
        font-size: 1.15rem;
    }

    .nav-links {
        display: flex;
        width: 100%;
        gap: 8px;
        padding-bottom: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links > a,
    .nav-auth-status a {
        margin-left: 0;
        padding: 8px 12px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--bg-surface);
        font-size: 0.86rem;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .nav-links > a:hover,
    .nav-links > a:focus-visible,
    .nav-auth-status a:hover,
    .nav-auth-status a:focus-visible {
        border-color: var(--primary);
        background: var(--bg-muted);
    }

    .nav-auth-status {
        margin-left: 0;
    }

    .nav-auth-status a {
        max-width: none;
    }

    .hero-cta {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .blog-tools {
        grid-template-columns: 1fr 1fr;
    }

    .post-search-input {
        grid-column: 1 / -1;
        min-height: 42px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .card-footer {
        flex-direction: column;
        gap: 6px;
    }

    .post-container {
        margin: 36px auto;
    }

    .info-card {
        padding: 22px 18px;
    }

    .info-card h1 {
        font-size: 1.65rem;
    }

    .tool-card {
        padding: 16px;
    }

    .auth-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .auth-actions > * {
        width: 100%;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .post-meta {
        gap: 10px;
        flex-wrap: wrap;
    }

    .post-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .tool-result p {
        flex-direction: column;
        gap: 4px;
    }

    .tool-actions .btn-primary,
    .tool-actions .btn-secondary {
        width: 100%;
    }

    .easter-egg-overlay {
        padding: 12px;
    }

    .easter-egg-card {
        border-radius: 16px;
        padding: 18px 16px 14px;
    }

    .easter-egg-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .easter-egg-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .easter-egg-actions .btn-primary,
    .easter-egg-actions .btn-secondary {
        width: 100%;
    }

    .easter-egg-hotspot {
        width: 28px;
        height: 28px;
        left: max(6px, env(safe-area-inset-left));
        bottom: max(6px, env(safe-area-inset-bottom));
        opacity: 0.42;
    }

    .back-to-top {
        right: 14px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}
