/**
 * 华策校园匿名评价论坛 - 全局样式
 * 配色方案：微博/朋友圈风格，温暖橙色主调
 */

/* ─── CSS变量 ─── */
:root {
    --primary-100: #E67E22;
    --primary-200: #FFA940;
    --primary-300: #FFF7E6;
    --accent-100: #FF6B6B;
    --accent-200: #C0392B;
    --text-100: #1A1A1A;
    --text-200: #8C8C8C;
    --bg-100: #FFFFFF;
    --bg-200: #F5F5F5;
    --bg-300: #E8E8E8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-pill: 20px;
}

/* ─── 重置与基础 ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg-200);
    color: var(--text-100);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ─── 按钮 ─── */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary-100);
    color: #fff;
    font-size: 16px;
    padding: 12px 16px;
    height: 44px;
}

.btn-primary:hover {
    background: var(--primary-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-100);
    color: var(--primary-100);
}

.btn-outline:hover {
    background: var(--primary-100);
    color: #fff;
}

.btn-danger {
    background: var(--accent-100);
    color: #fff;
}

.btn-danger:hover {
    background: var(--accent-200);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--accent-100);
    color: var(--accent-100);
}

.btn-danger-outline:hover {
    background: var(--accent-100);
    color: #fff;
}

.btn-small {
    padding: 4px 12px;
    font-size: 14px;
    border-radius: var(--radius-pill);
}

/* ─── 输入框 ─── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-100);
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--bg-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-100);
    background: var(--bg-100);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-100);
}

.form-input::placeholder {
    color: var(--text-200);
}

textarea.form-input {
    height: auto;
    min-height: 100px;
    padding: 12px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-200);
    margin-top: 4px;
}

/* ─── 卡片 ─── */
.card {
    background: var(--bg-100);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

/* ─── 分类标签 ─── */
.category-badge {
    display: inline-block;
    background: var(--primary-300);
    color: var(--primary-100);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.category-tag {
    display: inline-block;
    background: var(--bg-200);
    color: var(--text-100);
    font-size: 14px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background: var(--bg-300);
}

.category-tag.active {
    background: var(--primary-100);
    color: #fff;
}

.target-tag {
    display: inline-block;
    color: var(--primary-100);
    font-size: 12px;
}

/* ─── 状态标签 ─── */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
}

.status-normal {
    background: var(--primary-100);
    color: #fff;
}

.status-banned {
    background: var(--accent-100);
    color: #fff;
}

/* ─── 导航栏 ─── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 54px;
    background: var(--primary-100);
    display: flex;
    align-items: center;
}

.navbar-inner {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.navbar-search {
    flex: 1;
    max-width: 300px;
    margin: 0 16px;
}

.navbar-search form {
    display: flex;
    align-items: center;
    background: var(--bg-100);
    border-radius: var(--radius-pill);
    height: 36px;
    padding: 0 12px;
}

.navbar-search input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    color: var(--text-100);
}

.navbar-search input::placeholder {
    color: var(--text-200);
}

.navbar-search button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-200);
    font-size: 16px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-right a {
    color: #fff;
    font-size: 14px;
}

.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-300);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

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

.btn-publish {
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 14px;
}

/* ─── 子导航栏 ─── */
.sub-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 50px;
    background: var(--bg-100);
    border-bottom: 1px solid var(--bg-300);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.sub-navbar .back-link {
    color: var(--text-200);
    font-size: 14px;
    min-width: 60px;
}

.sub-navbar .sub-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

.sub-navbar .sub-action {
    min-width: 60px;
    text-align: right;
}

/* ─── 管理导航栏 ─── */
.admin-navbar {
    height: 48px;
    background: var(--primary-100);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

/* ─── 分类导航条 ─── */
.category-bar {
    position: sticky;
    top: 54px;
    z-index: 99;
    background: var(--bg-100);
    border-bottom: 1px solid var(--bg-300);
    padding: 12px 16px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.category-bar-inner {
    display: flex;
    gap: 8px;
}

/* ─── 帖子卡片 ─── */
.post-card {
    display: block;
    background: var(--bg-100);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--text-200);
    font-size: 14px;
    font-weight: 600;
}

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

.post-nickname {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-100);
}

.post-time {
    font-size: 12px;
    color: var(--text-200);
    margin-left: auto;
}

.post-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 8px;
    color: var(--text-100);
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-100);
    line-height: 1.6;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-images {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.post-thumb {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.post-footer {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-200);
    align-items: center;
}

/* ─── 帖子详情页 ─── */
.post-detail {
    background: var(--bg-100);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 16px;
}

.post-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-300);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.post-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-detail-meta {
    flex: 1;
}

.post-detail-nickname {
    font-size: 15px;
    font-weight: 700;
}

.post-detail-time {
    font-size: 12px;
    color: var(--text-200);
}

.post-detail-target {
    color: var(--primary-100);
    font-size: 14px;
    margin-top: 8px;
}

.post-detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-top: 12px;
    line-height: 1.4;
}

.post-detail-content {
    font-size: 15px;
    line-height: 1.8;
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-detail-images {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.post-detail-images img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.post-detail-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--bg-300);
    font-size: 14px;
    color: var(--text-200);
}

/* ─── 评论区 ─── */
.comments-section {
    margin: 0 16px 80px 16px;
}

.comments-title {
    text-align: center;
    color: var(--text-200);
    font-size: 14px;
    margin: 20px 0;
}

.comment-card {
    background: var(--bg-100);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    position: relative;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-300);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 12px;
}

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

.comment-nickname {
    font-size: 14px;
    font-weight: 700;
}

.comment-time {
    font-size: 12px;
    color: var(--text-200);
    margin-left: auto;
}

.comment-delete {
    font-size: 12px;
    color: var(--accent-100);
    margin-left: 8px;
}

.comment-content {
    font-size: 14px;
    color: var(--text-100);
    margin-top: 6px;
    line-height: 1.6;
    word-break: break-word;
}

/* ─── 底部评论输入 ─── */
.comment-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-100);
    border-top: 1px solid var(--bg-300);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 100;
}

.comment-input-bar textarea {
    flex: 1;
    height: 40px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--bg-300);
    padding: 8px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
}

.comment-input-bar textarea:focus {
    border-color: var(--primary-100);
}

.comment-input-bar button {
    background: var(--primary-100);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

/* ─── 分页 ─── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-100);
    border: 1px solid var(--bg-300);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-100);
    transition: all 0.2s ease;
}

.page-link:hover {
    border-color: var(--primary-100);
    color: var(--primary-100);
}

.page-link.active {
    background: var(--primary-100);
    color: #fff;
    border-color: var(--primary-100);
}

.page-link.disabled {
    color: var(--text-200);
    opacity: 0.5;
    pointer-events: none;
}

/* ─── 空状态 ─── */
.empty-state {
    text-align: center;
    padding: 60px 16px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    color: var(--text-200);
    margin-bottom: 4px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-200);
    margin-bottom: 12px;
}

/* ─── 提示消息 ─── */
.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-success {
    background: var(--primary-300);
    color: var(--primary-100);
}

.flash-error {
    background: #FFEBEE;
    color: var(--accent-100);
}

/* ─── 表格 ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th {
    background: var(--bg-300);
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-300);
    font-size: 14px;
}

.data-table tr:hover td {
    background: var(--bg-200);
}

.table-wrap {
    overflow-x: auto;
}

/* ─── 管理标签页 ─── */
.admin-tabs {
    display: flex;
    background: var(--bg-100);
    border-bottom: 2px solid var(--bg-300);
    padding: 0 16px;
    gap: 4px;
}

.admin-tab {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-200);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.admin-tab.active {
    color: var(--primary-100);
    border-bottom-color: var(--primary-100);
    font-weight: 600;
}

.admin-content {
    padding: 16px;
}

/* ─── 登录页 ─── */
.login-page {
    min-height: 100vh;
    background: var(--bg-200);
    display: flex;
    justify-content: center;
    padding-top: 80px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-100);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin: 0 16px;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo h1 {
    color: var(--primary-100);
    font-size: 24px;
    font-weight: 700;
}

.login-logo p {
    color: var(--text-200);
    font-size: 14px;
    margin-top: 4px;
}

.captcha-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.captcha-row .form-input {
    flex: 0 0 60%;
}

.captcha-img-wrap {
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-img {
    width: 120px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
}

.captcha-refresh {
    font-size: 12px;
    color: var(--text-200);
    white-space: nowrap;
}

.switch-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-200);
}

.switch-link a {
    color: var(--primary-100);
}

/* ─── 发布页 ─── */
.create-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 16px;
}

.category-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-option {
    position: relative;
}

.category-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.category-option label {
    display: inline-block;
    background: var(--bg-200);
    color: var(--text-100);
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.category-option label:hover {
    background: var(--bg-300);
}

.category-option input:checked + label {
    background: var(--primary-100);
    color: #fff;
    border-color: var(--primary-100);
}

.upload-area {
    background: var(--bg-200);
    border: 1px dashed var(--bg-300);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area span {
    color: var(--text-200);
    font-size: 14px;
}

.preview-images {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.preview-images img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* ─── 搜索页 ─── */
.search-bar {
    height: 50px;
    background: var(--bg-100);
    border-bottom: 1px solid var(--bg-300);
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
}

.search-bar input {
    flex: 1;
    max-width: 500px;
    height: 36px;
    border: 1px solid var(--bg-300);
    border-radius: var(--radius-pill);
    padding: 0 16px;
    font-size: 14px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--primary-100);
}

.search-info {
    padding: 12px 16px;
    font-size: 15px;
}

/* ─── 个人设置页 ─── */
.profile-page {
    max-width: 500px;
    margin: 20px auto;
    padding: 0 16px;
}

.avatar-section {
    text-align: center;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-300);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 28px;
    color: var(--text-200);
    font-weight: 600;
}

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

/* ─── 响应式 ─── */
@media (max-width: 768px) {
    .navbar-search {
        display: none;
    }

    .post-thumb {
        max-width: 100%;
        max-height: 200px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .login-card {
        padding: 24px;
    }

    .admin-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ─── 内容区 ─── */
.main-content {
    margin-top: 54px;
    min-height: calc(100vh - 54px);
}

.main-content-sub {
    margin-top: 50px;
    min-height: calc(100vh - 50px);
}

.content-wrap {
    max-width: 650px;
    margin: 0 auto;
    padding: 16px;
}

/* ─── 页面布局辅助 ─── */
.page-container {
    padding: 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-100);
}

/* ─── 搜索结果 ─── */
.search-results {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── 管理搜索栏 ─── */
.admin-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-search input {
    flex: 1;
    max-width: 300px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--bg-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.admin-search input:focus {
    outline: none;
    border-color: var(--primary-100);
}
