/* ============================================
   全局样式 - 个人博客系统（优化版）
   ============================================ */

/* ===== 重置样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: #667eea;
    text-decoration: none;
}
a:hover {
    color: #5a6fd6;
}

/* ===== 通用工具类 ===== */
.text-center { text-align: center; }
.text-muted { color: #888; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ===== 消息提示 ===== */
.message {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    transition: opacity 0.5s ease;
}
.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}
.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 头部导航 ===== */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}
.logo a {
    color: #333;
    text-decoration: none;
}
.logo a:hover {
    color: #667eea;
}

.nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}
.nav a {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.nav a:hover {
    background: #f0f0f0;
    color: #333;
}
.nav a.active {
    background: #667eea;
    color: white;
}
.nav a.active:hover {
    background: #5a6fd6;
}

/* 桌面端隐藏分类标签（侧边栏已显示） */
@media (min-width: 769px) {
    .nav .nav-divider,
    .nav .category-link {
        display: none !important;
    }
}

/* ===== 汉堡菜单按钮 ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-toggle:hover {
    background: rgba(0,0,0,0.05);
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== 警告提示 ===== */
.alert {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
}
.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}
.alert-warning a {
    color: #667eea;
    font-weight: 600;
}
.alert-warning a:hover {
    text-decoration: underline;
}

/* ===== 搜索栏 ===== */
.search-bar {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}
.search-bar form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}
.search-bar input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}
.search-bar button {
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.search-bar button:hover {
    background: #5a6fd6;
}
.search-bar .clear-search {
    color: #e74c3c;
    font-size: 14px;
}

/* ===== 主内容区 ===== */
.main-content {
    max-width: 1200px;
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    padding: 0 20px;
}

/* ===== 文章卡片 ===== */
.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    transition: box-shadow 0.3s, transform 0.2s;
}
.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.article-card .article-cover {
    background: #f0f0f0;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.article-card .article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.article-card:hover .article-cover img {
    transform: scale(1.02);
}
.article-card .article-info {
    padding: 20px 24px;
}
.article-card .article-info h2 {
    font-size: 20px;
    margin-bottom: 8px;
}
.article-card .article-info h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}
.article-card .article-info h2 a:hover {
    color: #667eea;
}
.article-card .article-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.article-card .article-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.article-card .article-tags .tag {
    background: #f0f0f0;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    transition: background 0.2s;
}
.article-card .article-tags .tag:hover {
    background: #e0e0e0;
}

/* ===== 统一按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 4px;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}
.btn-lg {
    padding: 10px 30px;
    font-size: 16px;
}
.btn-primary {
    background: #667eea;
    color: white;
}
.btn-primary:hover {
    background: #5a6fd6;
}
.btn-success {
    background: #27ae60;
    color: white;
}
.btn-success:hover {
    background: #1e8449;
}
.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-danger:hover {
    background: #c0392b;
}
.btn-warning {
    background: #f39c12;
    color: white;
}
.btn-warning:hover {
    background: #d68910;
}
.btn-secondary {
    background: #f0f0f0;
    color: #333;
}
.btn-secondary:hover {
    background: #e0e0e0;
}
.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}
.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* ===== 文章操作按钮（保持向后兼容） ===== */
.article-card .article-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.article-card .article-actions .btn-read {
    background: #667eea;
    color: white;
}
.article-card .article-actions .btn-read:hover {
    background: #5a6fd6;
}
.article-card .article-actions .btn-edit {
    background: #f39c12;
    color: white;
}
.article-card .article-actions .btn-edit:hover {
    background: #d68910;
}
.article-card .article-actions .btn-offline {
    background: #e74c3c;
    color: white;
}
.article-card .article-actions .btn-offline:hover {
    background: #c0392b;
}

/* ===== 侧边栏 ===== */
.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.sidebar-widget h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}
.category-list {
    list-style: none;
}
.category-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}
.category-list li:last-child {
    border-bottom: none;
}
.category-list li a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}
.category-list li a:hover {
    color: #667eea;
    background: #f0f4ff;
}

.user-info-sidebar {
    text-align: center;
}
.user-info-sidebar .sidebar-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid #667eea;
}
.user-info-sidebar p {
    font-size: 14px;
    color: #666;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
}
.pagination a {
    padding: 6px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    text-decoration: none;
    color: #667eea;
    font-size: 14px;
    transition: all 0.2s;
}
.pagination a:hover {
    background: #f0f0f0;
    border-color: #667eea;
}
.pagination span {
    color: #888;
    font-size: 14px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== 底部 ===== */
.footer {
    max-width: 1200px;
    margin: 40px auto 20px;
    padding: 24px 20px 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-inner p {
    color: #aaa;
    font-size: 13px;
    margin: 4px 0;
    line-height: 1.8;
}

.footer-inner a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-inner a:hover {
    color: #667eea;
}

.footer-inner img {
    height: 16px;
    vertical-align: middle;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 56px;
        padding: 0;
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 18px;
        flex-shrink: 0;
    }

    .logo a {
        display: block;
        padding: 4px 0;
    }

    /* 汉堡菜单 */
    .nav-toggle {
        display: flex;
        flex-shrink: 0;
        margin-left: auto;
    }

    .nav {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: stretch;
        padding: 20px 24px;
        gap: 2px;
        overflow-y: auto;
        z-index: 99;
        border-top: 1px solid #f0f0f0;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 8px;
        text-align: left;
        width: 100%;
        box-sizing: border-box;
        color: #333;
        text-decoration: none;
        transition: background 0.2s;
        border-bottom: 1px solid #f5f7fa;
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .nav a:hover {
        background: #f5f7fa;
    }

    .nav a.active {
        background: #667eea;
        color: white;
    }

    .nav a.active:hover {
        background: #5a6fd6;
    }

    /* 分类标签 */
    .nav .nav-divider {
        padding: 12px 16px 6px;
        font-size: 12px;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 4px;
    }

    .nav .category-link {
        padding-left: 32px;
        font-size: 15px;
        color: #666;
    }

    .nav .category-link::before {
        content: "📂 ";
        display: inline-block;
    }

    .nav .category-link:hover {
        background: #f0f4ff;
        color: #667eea;
    }

    .nav .logout-link {
        color: #e74c3c;
        margin-top: 8px;
        border-top: 1px solid #f0f0f0;
        padding-top: 12px;
    }

    .nav .logout-link:hover {
        background: #fdf2f2;
        color: #c0392b;
    }

    /* 主内容 */
    .main-content {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 16px;
    }

    /* 侧边栏隐藏 */
    .sidebar {
        display: none !important;
    }

    /* 搜索栏 */
    .search-bar {
        padding: 0 12px;
    }
    .search-bar input[type="text"] {
        font-size: 16px;
    }

    /* 文章卡片 */
    .article-card .article-cover {
        aspect-ratio: 16/9;
    }
    .article-card .article-info {
        padding: 14px 16px;
    }
    .article-card .article-info h2 {
        font-size: 17px;
    }
    .article-card .article-meta {
        font-size: 12px;
        gap: 8px;
    }
    .article-card .article-excerpt {
        -webkit-line-clamp: 2;
    }

    /* 分页 */
    .pagination a {
        padding: 4px 12px;
        font-size: 13px;
    }

    /* 容器 */
    .container {
        padding: 0 12px;
    }

    /* 登录/注册 */
    .auth-container {
        padding: 30px 20px;
        margin: 10px;
    }
    .auth-container h1 {
        font-size: 22px;
    }
    .auth-container .subtitle {
        font-size: 13px;
    }
    .form-group input {
        padding: 10px 14px;
        font-size: 16px;
    }
    .btn-primary {
        padding: 12px;
        font-size: 15px;
    }
    .code-group button {
        padding: 0 14px;
        font-size: 13px;
    }

    /* 个人中心 */
    .profile-page {
        margin: 16px auto;
        padding: 0 12px;
    }
    .profile-card {
        padding: 20px;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    .profile-name {
        font-size: 20px;
    }
    .profile-section h3 {
        font-size: 16px;
    }

    /* 文章详情 */
    .article-page {
        margin: 16px auto;
        padding: 0 12px;
    }
    .article-detail {
        padding: 20px;
    }
    .article-title {
        font-size: 22px;
    }
    .article-meta {
        font-size: 13px;
        gap: 8px;
    }
    .article-body {
        font-size: 15px;
        line-height: 1.7;
    }

    /* 评论 */
    .comment-item {
        padding: 12px 0;
    }
    .comment-header {
        flex-wrap: wrap;
    }
    .comment-header img {
        width: 28px;
        height: 28px;
    }
    .comment-content {
        margin-left: 38px;
        font-size: 14px;
    }
    .comment-actions {
        margin-left: 38px;
    }
    .sub-comments {
        margin-left: 20px;
        padding-left: 12px;
    }
    .reply-form {
        margin-left: 20px;
    }
    .reply-form textarea {
        min-height: 50px;
        font-size: 14px;
    }

    /* 回收站 */
    .recycle-page {
        margin: 16px auto;
        padding: 0 12px;
    }
    .recycle-card {
        padding: 20px;
    }
    .recycle-item {
        flex-direction: column;
        align-items: stretch;
    }
    .recycle-item .info .title {
        font-size: 15px;
    }
    .recycle-item .actions {
        justify-content: flex-end;
    }

    /* 发布页面 */
    .publish-page {
        margin: 16px auto;
        padding: 0 12px;
    }
    .publish-card {
        padding: 20px;
    }
    .publish-card h1 {
        font-size: 20px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .form-group textarea {
        min-height: 200px;
        font-size: 14px;
    }

    /* 管理后台 */
    .admin-page {
        padding: 0 12px;
        margin: 12px auto;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }
    .admin-header h1 {
        font-size: 20px;
    }
    .admin-tabs {
        flex-wrap: wrap;
        gap: 4px;
        padding: 4px;
    }
    .admin-tabs .tab {
        padding: 6px 12px;
        font-size: 12px;
        flex: 1 1 auto;
        text-align: center;
        min-width: 60px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-card {
        padding: 14px 16px;
    }
    .stat-card .number {
        font-size: 22px;
    }
    .admin-table {
        font-size: 12px;
        min-width: 600px;
    }
    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
    }
    .admin-table th {
        font-size: 11px;
    }
    .admin-table td {
        font-size: 12px;
    }
    .admin-table .badge {
        font-size: 10px;
        padding: 1px 8px;
    }
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    .form-inline input,
    .form-inline select {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }
    .form-inline .btn {
        width: 100%;
        text-align: center;
    }
    .profile-item-mini {
        padding: 10px 12px;
    }
    .comment-item-mini {
        padding: 8px 12px;
    }

    /* 底部 */
    .footer {
        padding: 16px 12px 12px;
        margin: 20px auto 10px;
    }
    .footer-inner p {
        font-size: 12px;
        line-height: 2;
    }
    .footer-inner a {
        display: inline-block;
    }
}

/* ===== 小屏幕手机 (最大宽度 480px) ===== */
@media (max-width: 480px) {
    .logo {
        font-size: 16px;
    }

    .nav a {
        padding: 10px 14px;
        font-size: 15px;
    }

    .nav .category-link {
        padding-left: 28px;
        font-size: 14px;
    }

    .auth-container {
        padding: 24px 16px;
    }
    .auth-container h1 {
        font-size: 20px;
    }

    .article-title {
        font-size: 19px;
    }
    .article-detail {
        padding: 14px;
    }
    .article-body {
        font-size: 14px;
    }

    .profile-card {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 10px 14px;
    }
    .stat-card .number {
        font-size: 18px;
    }
    .stat-card .label {
        font-size: 12px;
    }

    /* Toast 消息适配 */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================
   Toast 消息样式
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(20px);
    animation: toastIn 0.3s ease forwards;
    pointer-events: auto;
}

.toast.info { background: #667eea; }
.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.warning { background: #f39c12; }

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ============================================
   表单输入框移动端优化
   ============================================ */
input,
select,
textarea {
    font-size: 16px !important; /* 防止 iOS Safari 自动放大 */
}

@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================
   滚动条美化（桌面端）
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
/* ============================================
   表单样式（全局）
   ============================================ */

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-size: 15px;
    line-height: 1.8;
}

.form-group .hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ============================================
   认证页面专用样式
   ============================================ */

/* 验证码容器 */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-container input {
    flex: 1;
}

.captcha-container img {
    height: 46px;
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
}

/* 验证码输入组 */
.code-group {
    display: flex;
    gap: 10px;
}

.code-group input {
    flex: 1;
}

.code-group button {
    padding: 0 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    transition: background 0.3s;
    flex-shrink: 0;
}

.code-group button:hover {
    background: #5a6fd6;
}

.code-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   个人中心样式
   ============================================ */

.profile-role {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.role-developer {
    background: #fff3cd;
    color: #856404;
}

.role-author {
    background: #d1ecf1;
    color: #0c5460;
}

.role-member {
    background: #d4edda;
    color: #155724;
}

/* ============================================
   返回链接
   ============================================ */

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* ============================================
   待审核标签
   ============================================ */

.pending-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    display: inline-block;
}

/* ============================================
   帮助模态框
   ============================================ */

.help-modal {
    display: none !important;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.help-modal.active {
    display: flex !important;
}

.help-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.help-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.help-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: color 0.3s;
}

.help-modal-close:hover {
    color: #e74c3c;
}

.help-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.help-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section p {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 4px;
}

.help-contact {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.help-contact .contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
    font-size: 13px;
    background: #f8f9fa;
    padding: 4px 14px;
    border-radius: 20px;
}

.help-contact .contact-item a {
    color: #667eea;
    text-decoration: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 滚动条美化（模态框专用） */
.help-modal-body::-webkit-scrollbar {
    width: 6px;
}
.help-modal-body::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}
.help-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================
   认证页面表单链接
   ============================================ */

.form-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}

.form-links a {
    color: #667eea;
    text-decoration: none;
}

.form-links a:hover {
    text-decoration: underline;
}

/* ============================================
   帮助链接
   ============================================ */

.help-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.help-link .help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 14px;
    padding: 6px 16px;
    border-radius: 20px;
    transition: all 0.3s;
    background: #f8f9fa;
    cursor: pointer;
    border: none;
}

.help-link .help-btn:hover {
    background: #e8ecf1;
    color: #667eea;
    transform: translateY(-1px);
}

/* ============================================
   Toast 消息移动端适配
   ============================================ */

@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* ============================================
   修复：文章详情页 .article-actions 使用全局 .btn
   ============================================ */

.article-actions .btn {
    /* 继承全局 .btn 样式，无需额外定义 */
}

/* ============================================
   修复：分隔线
   ============================================ */

.divider {
    border: none;
    border-top: 2px solid #f0f0f0;
    margin: 30px 0;
}

/* ============================================
   修复：验证码输入框特殊状态
   ============================================ */

#regCode:focus,
#forgotCode:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#regCode.correct,
#forgotCode.correct {
    border-color: #27ae60;
    background: #f0fff4;
}

#regCode.error,
#forgotCode.error {
    border-color: #e74c3c;
    background: #fff5f5;
}
/* ============================================
   认证页面错误/成功消息
   ============================================ */

.error-msg {
    background: #fff3f3;
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.success-msg {
    background: #f0fff4;
    color: #27ae60;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}