* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
    background: #f3f4f6;
    color: #222;
    min-height: 100vh;
}

/* ====== 登录页 ====== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(160deg, #2563eb 0%, #1e40af 100%);
}
.auth-box {
    background: white;
    padding: 24px 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    max-height: 92vh;
    overflow-y: auto;
}
.auth-box h1 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 10px;
}
.rule-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #7c2d12;
    margin-bottom: 14px;
    line-height: 1.7;
}
.rule-box b {
    display: block;
    margin-bottom: 4px;
}
.tab-bar {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 14px;
}
.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}
.tab-btn.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
}
.form input, .form select, .modal-box select, .modal-box textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: inherit;
}
.form input:focus, .form select:focus {
    outline: none;
    border-color: #2563eb;
}
.primary-btn {
    width: 100%;
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
}
.primary-btn:hover {
    background: #1d4ed8;
}
.msg {
    text-align: center;
    font-size: 14px;
    margin-top: 8px;
    color: #dc2626;
    min-height: 18px;
}

/* ====== 头部 ====== */
header {
    background: #2563eb;
    color: white;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
header h1 {
    font-size: 17px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}
.nav-btn {
    background: rgba(255,255,255,.18);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.nav-btn.active {
    background: white;
    color: #2563eb;
    font-weight: 600;
}
.admin-badge {
    background: #fbbf24;
    color: #222;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.small-btn {
    background: rgba(255,255,255,.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.small-btn.gray {
    background: #e2e8f0;
    color: #334155;
}
.danger-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 12px;
}

/* ====== 公告栏 ====== */
.announce-bar {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 12px;
}
.announce-item {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 13px;
}
.announce-item .a-title {
    font-weight: 700;
    color: #1e40af;
}
.announce-item .a-time {
    color: #94a3b8;
    font-size: 11px;
    margin-left: 8px;
}

/* ====== 发帖 ====== */
.post-box {
    background: white;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 14px;
}
.post-box-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}
.post-box-top select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}
.anon-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}
textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    resize: vertical;
    font-size: 15px;
    font-family: inherit;
}
.post-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.file-btn {
    background: #f1f5f9;
    color: #334155;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: inline-block;
}
.img-preview {
    max-height: 100px;
    max-width: 100px;
    border-radius: 8px;
    object-fit: cover;
}
.img-hint {
    color: #777;
    font-size: 12px;
}

/* ====== 分类筛选 / 管理tab ====== */
.feed-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.feed-tabs button {
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}
.feed-tabs button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    font-weight: 600;
}

/* ====== 帖子卡片 ====== */
.post-item {
    background: white;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 12px;
}
.post-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}
.post-author {
    font-weight: 600;
    font-size: 14px;
}
.post-time {
    color: #999;
    font-size: 11px;
}
.tag {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    margin-right: 5px;
    font-weight: 600;
}
.tag-pin {
    background: #ef4444;
    color: white;
}
.tag-star {
    background: #fbbf24;
    color: #222;
}
.tag-cat {
    background: #e0e7ff;
    color: #4338ca;
}
.tag-hidden {
    background: #e2e8f0;
    color: #475569;
}
.tag-deleted {
    background: #fee2e2;
    color: #b91c1c;
}
.anon-tag {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 4px;
}
.post-content {
    margin: 8px 0;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 14px;
}
.post-img {
    max-width: 100%;
    border-radius: 10px;
    margin: 6px 0;
}
.post-actions-row {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}
.action-link {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 13px;
    padding: 2px 0;
}
.action-link.liked {
    color: #ef4444;
    font-weight: 600;
}
.action-link.report {
    color: #94a3b8;
}
.post-admin-buttons {
    margin: 8px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.post-admin-buttons button {
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    background: #eef2ff;
    color: #2563eb;
}
.post-admin-buttons button.del {
    background: #fee2e2;
    color: #dc2626;
}
.real-info {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: #475569;
    margin: 6px 0;
    word-break: break-all;
}

/* ====== 评论 ====== */
.comment-area {
    margin-top: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}
.comment-title {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}
.comment-item {
    background: #f8fafc;
    padding: 7px 10px;
    border-radius: 8px;
    margin: 5px 0;
    font-size: 13px;
    word-break: break-word;
}
.comment-item .comment-author {
    font-weight: 600;
    color: #2563eb;
    margin-right: 6px;
}
.comment-item.del {
    color: #94a3b8;
    text-decoration: line-through;
}
.comment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}
.comment-actions input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}
.comment-actions .anon-label {
    font-size: 12px;
    white-space: nowrap;
}
.comment-submit {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

/* ====== 个人中心 ====== */
.profile-header {
    background: white;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.profile-header h2 {
    font-size: 17px;
    margin-bottom: 12px;
}
.profile-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.profile-tabs .tab-btn {
    flex: 0 1 auto;
    padding: 8px 16px;
}
.mine-item {
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    font-size: 14px;
}
.mine-item .mine-head {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 6px;
    gap: 8px;
    flex-wrap: wrap;
}
.mine-item .mine-content {
    word-break: break-word;
    margin-bottom: 6px;
}
.status-pending { color: #d97706; }
.status-done { color: #16a34a; }
.status-dismiss { color: #94a3b8; }

/* ====== 管理后台 ====== */
.admin-header {
    background: #111827;
}
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.stat-card .num {
    font-size: 26px;
    font-weight: 700;
    color: #2563eb;
}
.stat-card .label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
.admin-panel {
    background: white;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.admin-panel h3 {
    font-size: 15px;
    margin-bottom: 10px;
}
.admin-row {
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 0;
    font-size: 13px;
}
.admin-row:last-child {
    border-bottom: none;
}
.admin-row .row-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.admin-ops {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.admin-ops button {
    border: none;
    border-radius: 7px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    background: #eef2ff;
    color: #2563eb;
}
.admin-ops button.del { background: #fee2e2; color: #dc2626; }
.admin-ops button.warn { background: #fffbeb; color: #b45309; }
.admin-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.admin-input-row input {
    flex: 1;
    min-width: 160px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}
.log-line {
    font-size: 12px;
    color: #475569;
    padding: 5px 0;
    border-bottom: 1px solid #f8fafc;
}
.batch-check {
    margin-right: 6px;
    transform: scale(1.2);
    accent-color: #2563eb;
}

/* ====== 弹窗 ====== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 16px;
}
.modal-box {
    background: white;
    padding: 20px;
    border-radius: 14px;
    width: 100%;
    max-width: 380px;
}
.modal-box h3 {
    margin-bottom: 10px;
}
.modal-box textarea {
    min-height: 70px;
    resize: vertical;
}
.modal-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}
.modal-btns .primary-btn {
    width: auto;
    padding: 8px 18px;
}

.empty-tip {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

@media (max-width: 480px) {
    header h1 { font-size: 15px; }
    .container { padding: 10px; }
}
