/* static/style.css */

/* --- 1. 变量与基础设置 --- */
:root {
    /* 冷静克制的调色板 */
    --bg-body: #fafafa; /* 极淡的灰白，不刺眼 */
    --bg-card: #ffffff;
    --text-main: #27272a; /* 深灰，非纯黑 */
    --text-muted: #71717a;
    --border-color: #e4e4e7;

    /* 强调色 (会被 layout.js 季节逻辑覆盖，这里是默认值) */
    --accent: #52525b; /* 默认使用中性灰 */

    /* 布局 */
    --container-width: 720px;
    --header-height: 80px;

    /* 风格：锐利 */
    --radius: 0px; /* 去除圆角，追求冷静 */

    /* 字体 */
    --font-sans: "Noto Sans SC", sans-serif;
    --font-serif: "Noto Serif SC", serif;
    --font-mono: Consolas, "Noto Sans SC", monospace;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #09090b;
        --bg-card: #18181b;
        --text-main: #e4e4e7;
        --text-muted: #a1a1aa;
        --border-color: #27272a;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-bottom: 40px;
}

.btn-page {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #fff;
}

.btn-page:hover {
    background: #f7f7f7;
    border-color: #bbb;
    color: #333;
}

.page-info {
    color: #888;
    font-size: 0.9rem;
}

/* Article Navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-nav a {
    text-decoration: none;
    color: #333;
    max-width: 45%;
    display: flex;
    flex-direction: column;
}

.article-nav .nav-prev {
    align-items: flex-start;
    text-align: left;
}

.article-nav .nav-next {
    align-items: flex-end;
    text-align: right;
}

.article-nav a:hover .nav-title {
    color: #007bff;
}

.nav-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 4px;
}

.nav-title {
    font-size: 1rem;
    font-weight: 500;
}

/* Figure & Caption */
.post-figure {
    margin: 30px 0;
    text-align: center;
}

.post-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.post-figure figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.7;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    transition:
        background-color 0.3s,
        color 0.3s;
}

/* --- 2. 布局组件 --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px 100px;
}

/* 导航栏 */
.nav-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
}

.site-logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-item {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
}

/* 链接下划线效果（仅在激活时） */
.nav-item.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
}

/* 页脚 */
.site-footer {
    margin-top: 80px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- 3. 通用排版 --- */
h1,
h2,
h3 {
    font-family: var(--font-serif);
    color: var(--text-main);
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}
h1 {
    font-size: 2.2rem;
    letter-spacing: -0.03em;
}
h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}
p {
    margin-bottom: 1.6em;
    color: var(--text-muted);
}
a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 3px;
    transition: all 0.2s;
}
a:hover {
    text-decoration-color: var(--accent);
    color: var(--accent);
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 60px;
    font-style: italic;
}

/* --- 4. 首页文章列表 --- */
.post-item {
    display: flex; /* 启用 Flexbox */
    justify-content: space-between; /* 两端对齐 */
    align-items: flex-start; /* 顶部对齐 */
    gap: 24px; /* 图文间距 */
    padding: 32px 0;
    border-bottom: 1px dashed var(--border-color);
    text-decoration: none !important;
}
.post-content {
    flex: 1; /* 占据剩余空间 */
    min-width: 0; /* 防止文字溢出导致布局破坏 */
}
.post-thumb {
    width: 120px; /* 固定宽度 */
    height: 120px; /* 固定高度 -> 正方形 */
    flex-shrink: 0; /* 防止图片被压缩 */
    object-fit: cover; /* 关键：裁切图片填满容器 */
    border-radius: 4px; /* 轻微圆角 */
    background-color: var(--border-color); /* 图片加载前的占位色 */
    border: 1px solid var(--border-color);
}
@media (max-width: 600px) {
    .post-thumb {
        display: none;
    }
}
.post-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin: 0 0 8px 0; /*稍微调小间距*/
    color: var(--text-main);
    transition: color 0.2s;
    line-height: 1.3;
}
.post-item:hover .post-title {
    color: var(--accent);
}
.post-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.post-desc {
    margin-top: 12px;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- 5. 关于页 (About) --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
}
.avatar {
    width: 120px;
    height: 120px;
    padding: 4px;
    object-fit: cover;
}
.social-links {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 20px;
}

/* --- 6. 画廊页 (Gallery) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}
.gallery-item {
    margin: 0;
}
.gallery-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    background: var(--border-color);
    filter: grayscale(20%); /* 默认微灰，增加冷静感 */
    transition: filter 0.3s;
}
.gallery-item:hover .gallery-img {
    filter: grayscale(0%);
}
.caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}

/* --- 7. 文章详情页 (Article) --- */
.article-header {
    text-align: center;
    margin: 40px 0 60px;
}
.article-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}
.article-tags {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: var(--radius);
}
.article-content {
    font-size: 1.05rem;
    color: var(--text-main);
}
.article-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    border-radius: var(--radius);
}
.article-content img {
    max-width: 600px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- 8. 交互区域 (Like & Comment) --- */
.interaction-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

/* 点赞按钮 - 扁平化，无阴影 */
.like-wrapper {
    text-align: center;
    margin-bottom: 60px;
}
.btn-like {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    font-family: var(--font-sans);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    transition: all 0.2s;
    border-radius: var(--radius);
}
.btn-like:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}
.btn-like.liked {
    background-color: var(--bg-body);
    border-color: #ef4444;
    color: #ef4444;
}

/* 评论区 */
.comment-form textarea {
    width: 100%;
    height: 120px;
    padding: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--text-main);
}

.btn-submit {
    margin-top: 12px;
    background: var(--text-main);
    color: var(--bg-card);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    float: right;
}
.btn-submit:hover {
    opacity: 0.9;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin-top: 60px;
}
.comment-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}
.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}
.comment-body {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 年份标题 */
.gallery-year-header {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin: 60px 0 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--text-main);
    display: inline-block;
}

/* 照片卡片容器 */
.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 60px; /* 卡片之间的间距 */
}

.gallery-card {
    display: block;
    margin-bottom: 20px;
    animation: fadeIn 0.6s ease;
}

/* 图片样式 */
.gallery-card-img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin-bottom: 20px;
    /*border: 1px solid var(--border-color);*/
    /*background-color: var(--bg-card);*/
}

/* 文本内容 */
.gallery-card-content {
    max-width: 100%;
}

.gallery-card-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin: 0 0 12px 0;
    color: var(--text-main);
}

.gallery-card-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 8px;
}

.gallery-photographer {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: 10px;
    display: block;
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 9. 移动端响应式布局 --- */
@media (max-width: 640px) {
    .container {
        padding: 0 20px 60px;
    }

    /* 导航栏：垂直堆叠 */
    .nav-header {
        height: auto;
        flex-direction: column;
        padding: 20px 0;
        gap: 16px;
        margin-bottom: 40px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    /* 标题与排版调整 */
    h1 {
        font-size: 1.8rem;
        margin-top: 1.5em;
    }

    /* 关于页：头像居中 */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .social-links {
        justify-content: center;
    }
}
/* --- 10. Chirp (Chirps) --- */
.chirp-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease;
}

.chirp-meta {
    display: flex;
    gap: 12px;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.9;
}

.chirp-date {
    font-size: 0.9rem;
    opacity: 0.8;
}

.chirp-tags,
.chirp-pill-btn {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: var(--radius);
    line-height: 1.6;
}

.chirp-tags {
    margin-left: 12px;
}

.chirp-pill-btn {
    margin-left: 12px;
    cursor: pointer;
    background: var(--bg-card);
}

.chirp-pill-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.chirp-meta-spacer {
    flex: 1;
}

.chirp-content {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 8px 0 12px 0;
}

/* media */
.chirp-images-single img,
.chirp-media-single {
    margin-top: 8px;
}

.chirp-images-single img {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: block;
}

.chirp-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.chirp-images-grid img {
    height: 200px;
    width: auto;
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--border-color);
    transition: opacity 0.3s;
}

.chirp-images-grid img:hover {
    opacity: 0.9;
}

.chirp-media-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.chirp-media {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    object-fit: cover;
}

/* comments */
.chirp-actions {
    margin-top: 10px;
}

.chirp-toggle-comments,
.chirp-submit-comment,
.chirp-cancel-reply,
.chirp-dialog-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.chirp-toggle-comments:hover,
.chirp-submit-comment:hover,
.chirp-cancel-reply:hover,
.chirp-dialog-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.chirp-submit-comment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chirp-comments {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.chirp-comments-body {
    margin-top: 10px;
}

.chirp-comments-empty {
    opacity: 0.7;
    padding: 6px 0;
    font-family: var(--font-sans);
    color: var(--text-muted);
}

.chirp-comment {
    padding: 8px 0 6px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chirp-comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chirp-comment-time {
    font-size: 0.8rem;
    opacity: 0.7;
}

.chirp-reply-btn {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: underline;
}

.chirp-reply-btn:hover {
    opacity: 1;
}

.chirp-comment-content {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    word-break: break-word;
}

.chirp-replying {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    opacity: 0.75;
    color: var(--text-muted);
}

/* input */
.chirp-comment-form textarea.chirp-comment-input,
.chirp-comment-input,
.chirp-dialog-text {
    width: 100%;
    resize: vertical;
    border-radius: var(--radius);
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
}

.chirp-comment-form textarea.chirp-comment-input:focus,
.chirp-comment-input:focus,
.chirp-dialog-text:focus {
    border-color: var(--text-main);
}

.chirp-comment-form-actions,
.chirp-dialog-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.chirp-dialog-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

/* dialog */
.chirp-dialog {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0;
    max-width: 560px;
    width: calc(100vw - 32px);
}

.chirp-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.chirp-dialog-form {
    padding: 16px;
}

.chirp-dialog-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.chirp-dialog-primary {
    color: var(--text-main);
}

/* --- Admin extra styles for new admin.html --- */
.admin-login-card {
    width: min(560px, calc(100vw - 32px));
}

.admin-login-title {
    margin-top: 0;
    margin-bottom: 24px;
    font-family: var(--font-serif);
}

.admin-login-actions {
    margin-top: 8px;
}

.admin-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 12px;
    font-family: var(--font-mono);
    line-height: 1.6;
    white-space: pre-wrap;
}

.admin-debug-wrap {
    margin-bottom: 20px;
}

.admin-log-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.admin-log-card-login {
    margin-top: 18px;
    margin-bottom: 0;
}

.admin-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.admin-log-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-log-output {
    margin: 0;
    min-height: 88px;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-mono);
    font-size: 0.83rem;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.admin-server-meta {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-field-help {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.admin-field-help code {
    font-family: var(--font-mono);
}

.admin-upload-success {
    color: #22c55e;
    font-family: var(--font-mono);
    font-weight: bold;
    margin-bottom: 8px;
}

.admin-upload-label {
    display: block;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.admin-chirp-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-chirp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-chirp-idline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.admin-chip-label {
    color: var(--text-muted);
}

.admin-chip-value {
    display: inline-block;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2px 8px;
    background: var(--bg-body);
    color: var(--text-main);
}

.admin-btn-toggle.active {
    border-color: var(--text-main);
    color: var(--text-main);
}

.admin-chirp-upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-chirp-upload-row .admin-input {
    flex: 1;
}

.admin-chirp-media-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-chirp-media-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

@media (max-width: 720px) {
    .admin-chirp-upload-row,
    .admin-chirp-media-row {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* =========================
   Admin base styles
   append to style.css
   ========================= */

.admin-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 96px;
    color: var(--text-main);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 9px 14px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
    border-radius: var(--radius);
    transition:
        border-color 0.2s,
        color 0.2s,
        background-color 0.2s,
        opacity 0.2s;
}

.admin-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.admin-btn.active {
    border-color: var(--text-main);
    color: var(--text-main);
    background: var(--bg-body);
}

.admin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.admin-btn-primary {
    background: var(--text-main);
    color: var(--bg-card);
    border-color: var(--text-main);
}

.admin-btn-primary:hover {
    opacity: 0.9;
    color: var(--bg-card);
}

.admin-btn-danger {
    border-color: #ef4444;
    color: #ef4444;
}

.admin-btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-form-group label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.admin-input,
.admin-textarea,
.admin-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    border-radius: var(--radius);
    outline: none;
}

.admin-input,
.admin-select {
    min-height: 44px;
}

.admin-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.7;
}

.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
    border-color: var(--text-main);
}

.admin-input::placeholder,
.admin-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.admin-modal {
    width: min(680px, calc(100vw - 32px));
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-sizing: border-box;
}

.admin-split {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-main {
    min-width: 0;
    min-height: 520px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 20px;
    box-sizing: border-box;
}

.admin-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.admin-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-main);
    word-break: break-word;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.admin-list-item:last-child {
    border-bottom: none;
}

.admin-list-item:hover,
.admin-list-item.active {
    background: var(--bg-body);
    color: var(--accent);
}

.admin-empty-state {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-align: center;
    border: 1px dashed var(--border-color);
    background: var(--bg-card);
}

.admin-mb-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 18px;
    margin-bottom: 18px;
    box-sizing: border-box;
}

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

.admin-flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-notification {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    background: var(--text-main);
    color: var(--bg-card);
    border: 1px solid var(--text-main);
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.admin-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.admin-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.admin-gallery-item {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
}

@media (max-width: 980px) {
    .admin-split {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-main {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .admin-layout {
        padding: 20px 16px 88px;
    }

    .admin-header {
        align-items: stretch;
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-fab {
        right: 16px;
        bottom: 16px;
    }

    .admin-notification {
        right: 16px;
        bottom: 16px;
    }
}
/* --- Admin Chirps Table + Modal Editor --- */
.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(127, 127, 127, 0.18);
    background: var(--bg-card);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(127, 127, 127, 0.14);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.admin-table thead th {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--bg-body);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-table tbody tr:hover {
    background: rgba(127, 127, 127, 0.04);
}

.admin-table-empty {
    text-align: center !important;
    color: var(--text-muted);
    padding: 32px 20px !important;
}

.admin-cell-center {
    text-align: center !important;
    vertical-align: middle !important;
}

.admin-chirp-content-cell {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 520px;
}

.chirp-editor-dialog {
    width: min(900px, calc(100vw - 32px));
    max-width: 900px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
}

.chirp-editor-dialog::backdrop {
    background: rgba(0, 0, 0, 0.52);
}

.chirp-editor-form {
    padding: 24px;
}

.chirp-editor-toprow {
    align-items: end;
}

.chirp-editor-actions {
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .chirp-editor-form {
        padding: 16px;
    }

    .admin-table {
        min-width: 760px;
    }
}

.admin-table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
}
.admin-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.035);
}
.admin-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.01);
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}
.admin-cell-center {
    text-align: center !important;
    vertical-align: middle !important;
}
.admin-chirp-content-cell {
    white-space: pre-wrap;
    word-break: break-word;
    text-align: center;
    vertical-align: middle !important;
}
.chirp-editor-dialog {
    width: min(920px, calc(100vw - 32px));
    max-width: 920px;
    padding: 0;
}
.chirp-editor-form {
    padding: 24px;
}
.chirp-editor-toprow {
    grid-template-columns: minmax(0, 1fr) 180px;
    align-items: stretch;
    gap: 16px;
}
.chirp-editor-toprow .admin-form-group {
    display: flex;
    flex-direction: column;
}
.chirp-editor-toprow .admin-input,
.chirp-editor-toprow .admin-btn-toggle {
    min-height: 46px;
    height: 46px;
    width: 100%;
    box-sizing: border-box;
}
.chirp-editor-toprow .admin-btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}
.chirp-editor-actions {
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}
.admin-file-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.admin-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f3f4f6;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
    font: inherit;
}
.admin-file-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}
.admin-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 46px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}
.admin-file-empty {
    color: rgba(232, 232, 234, 0.62);
    line-height: 1.5;
}
.admin-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    max-width: 100%;
    padding: 0 10px 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.055);
}
.admin-file-chip-name {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.94rem;
}
.admin-file-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.admin-file-chip-remove:hover {
    background: rgba(255, 255, 255, 0.14);
}
