/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5BA4E6;
    --primary-light: #E8F4FD;
    --primary-dark: #3A8FD4;
    --text: #333;
    --text-light: #666;
    --bg: #F5F9FC;
    --white: #fff;
    --border: #E0E8F0;
    --shadow: rgba(91, 164, 230, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-strong: rgba(255, 255, 255, 0.85);
    --glass-bg-mobile: rgba(255, 255, 255, 0.82);
    --glass-border-mobile: rgba(255, 255, 255, 0.6);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* 背景装饰 */
body:not(.admin-body):not(.login-body)::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(91, 164, 230, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: floatBg 20s ease-in-out infinite;
}

body:not(.admin-body):not(.login-body)::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(91, 164, 230, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: floatBg 25s ease-in-out infinite reverse;
}

@keyframes floatBg {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

/* 毛玻璃效果 - 增强版 */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.glass-strong {
    background: var(--glass-strong);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
}

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

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

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(91, 164, 230, 0.3); }
    50% { box-shadow: 0 0 20px rgba(91, 164, 230, 0.6); }
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-180deg) scale(0.5); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* 头部 */
.header {
    background: var(--glass-strong);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: fadeInDown 0.5s ease-out;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-light);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
}

.nav a:hover::before, .nav a.active::before {
    opacity: 1;
}

.nav a:hover, .nav a.active {
    color: var(--primary);
    transform: translateY(-2px);
}

.nav a span {
    position: relative;
    z-index: 1;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    gap: 5px;
    transition: all 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 主内容区 */
main {
    padding: 30px 0;
    min-height: calc(100vh - 160px);
}

/* 卡片样式 - 增强毛玻璃 */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }

.card:hover {
    box-shadow: 0 12px 40px var(--shadow);
    transform: translateY(-4px);
    border-color: rgba(91, 164, 230, 0.3);
}

/* 帖子列表 */
.post-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title:hover {
    color: var(--primary);
}

.post-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-content-preview {
    color: var(--text-light);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.status-pending {
    background: rgba(255, 243, 205, 0.8);
    color: #856404;
    border: 1px solid rgba(255, 243, 205, 0.5);
}

.status-approved {
    background: rgba(212, 237, 218, 0.8);
    color: #155724;
    border: 1px solid rgba(212, 237, 218, 0.5);
}

.status-rejected {
    background: rgba(248, 215, 218, 0.8);
    color: #721C24;
    border: 1px solid rgba(248, 215, 218, 0.5);
}

/* 按钮 - 增强动画 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(91, 164, 230, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 164, 230, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(248, 215, 218, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #721C24;
    border: 1px solid rgba(248, 215, 218, 0.5);
}

.btn-danger:hover {
    background: rgba(245, 198, 203, 0.9);
    transform: translateY(-2px);
}

.btn-success {
    background: rgba(212, 237, 218, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #155724;
    border: 1px solid rgba(212, 237, 218, 0.5);
}

.btn-success:hover {
    background: rgba(195, 230, 203, 0.9);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--shadow);
    background: var(--white);
}

.form-control::placeholder {
    color: #aaa;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-box input {
    flex: 1;
}

/* 帖子详情 */
.post-detail {
    padding: 30px;
}

.post-detail h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text);
    animation: fadeIn 0.5s ease-out;
}

.post-detail .post-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.post-detail .content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

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

.comments-section h3 {
    margin-bottom: 20px;
    color: var(--text);
}

.comment-item {
    padding: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 15px;
    animation: fadeInLeft 0.4s ease-out;
    transition: all 0.3s ease;
}

.comment-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow);
}

.comment-item .meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.comment-item .content {
    font-size: 0.95rem;
    white-space: pre-wrap;
}

/* 页脚 */
.footer {
    background: var(--glass-strong);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.pagination a {
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination a:hover, .pagination a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 164, 230, 0.3);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    animation: fadeIn 0.6s ease-out;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
    animation: pulse 3s ease-in-out infinite;
}

/* 后台管理 */
.login-body {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(91, 164, 230, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: floatBg 20s ease-in-out infinite;
}

.login-body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(91, 164, 230, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: floatBg 25s ease-in-out infinite reverse;
}

.login-container {
    max-width: 400px;
    width: 100%;
    animation: scaleIn 0.5s ease-out;
}

.login-container .card {
    padding: 40px 30px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

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

.login-logo img {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    box-shadow: 0 8px 25px var(--shadow);
}

.login-logo p {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.admin-body {
    background: var(--bg);
    min-height: 100vh;
}

.admin-body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(91, 164, 230, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: floatBg 20s ease-in-out infinite;
}

.admin-body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(91, 164, 230, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: floatBg 25s ease-in-out infinite reverse;
}

.admin-main {
    padding: 20px 0;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
    animation: fadeInDown 0.5s ease-out;
}

.admin-page-header h2 {
    font-size: 1.5rem;
    color: var(--text);
}

.admin-welcome {
    margin-bottom: 25px;
    animation: fadeInDown 0.5s ease-out;
}

.admin-welcome h2 {
    font-size: 1.5rem;
    color: var(--text);
}

.admin-section-title {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.1rem;
}

.admin-logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.admin-header {
    background: var(--glass-strong);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    padding: 15px 0;
    animation: fadeInDown 0.5s ease-out;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text);
}

.admin-nav a:hover, .admin-nav a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.admin-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.setting-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

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

.setting-section h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.api-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.api-status.active {
    background: rgba(212, 237, 218, 0.8);
    color: #155724;
}

.api-status.inactive {
    background: rgba(248, 215, 218, 0.8);
    color: #721C24;
}

.countdown-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(91, 164, 230, 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.countdown-box strong {
    font-size: 1.1rem;
}

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

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

.admin-table th {
    background: var(--primary-light);
    font-weight: 600;
    color: var(--primary-dark);
}

.admin-table tr {
    transition: all 0.3s ease;
}

.admin-table tr:hover {
    background: var(--primary-light);
    transform: scale(1.01);
}

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

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: bounceIn 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px var(--shadow);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* 登录表单 */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    animation: scaleIn 0.5s ease-out;
}

.login-container .card {
    padding: 40px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    animation: fadeInDown 0.5s ease-out;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text);
}

.page-header p {
    color: var(--text-light);
}

/* 搜索容器 */
.search-container {
    max-width: 900px;
    margin: 0 auto;
}

.search-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text);
    animation: fadeInDown 0.5s ease-out;
}

.search-result-info {
    color: var(--text-light);
    margin-bottom: 20px;
}

mark {
    background: rgba(91, 164, 230, 0.2);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 发帖表单容器 */
.post-form-container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.post-form-container h2 {
    margin-bottom: 10px;
    color: var(--text);
}

.form-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.alert {
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(212, 237, 218, 0.8);
    color: #155724;
    border: 1px solid rgba(212, 237, 218, 0.5);
}

.alert-error {
    background: rgba(248, 215, 218, 0.8);
    color: #721C24;
    border: 1px solid rgba(248, 215, 218, 0.5);
}

/* 推荐页 */
.rank-number {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.rank-number:hover {
    transform: scale(1.1);
}

.hot-badge {
    background: rgba(255, 243, 205, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #856404;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 243, 205, 0.5);
}

/* 评论区表单 */
.comment-form .form-group {
    margin-bottom: 0;
}

/* 筛选标签 */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 投票相关全局样式 */
.poll-card {
    border: 2px solid rgba(91, 164, 230, 0.12);
    margin-top: 24px;
}

.poll-card:hover {
    border-color: rgba(91, 164, 230, 0.25);
}

.poll-card h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: var(--text);
}

.poll-total-votes {
    color: var(--text-light);
    font-size: 0.82rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.poll-total-votes::before {
    content: '🗳️';
    font-size: 0.9rem;
}

.poll-option-label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(91, 164, 230, 0.03);
    border: 1.5px solid var(--border);
    position: relative;
}

.poll-option-label:hover {
    background: rgba(91, 164, 230, 0.08);
    border-color: var(--primary);
    transform: translateX(3px);
}

.poll-option-label:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 164, 230, 0.1);
}

.poll-option-label input[type="radio"] {
    display: none;
}

.poll-radio {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.poll-option-label:hover .poll-radio {
    border-color: var(--primary);
}

.poll-option-label input:checked + .poll-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.poll-option-label input:checked + .poll-radio::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.poll-option-text {
    font-size: 0.95rem;
    color: var(--text);
    user-select: none;
}

.poll-form .btn {
    margin-top: 18px;
    width: 100%;
    font-size: 0.95rem;
    padding: 12px;
}

.poll-results {
    margin-top: 10px;
}

.poll-result-item {
    margin-bottom: 16px;
}

.poll-result-item.user-voted .poll-option-text {
    color: var(--primary);
    font-weight: 600;
}

.poll-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.poll-result-header .poll-option-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.poll-vote-count {
    color: var(--text-light);
    font-size: 0.82rem;
    white-space: nowrap;
}

.poll-bar {
    height: 10px;
    background: rgba(91, 164, 230, 0.08);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.poll-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--primary-dark));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
}

.poll-voted-hint {
    text-align: center;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* 投票开关 */
.poll-toggle {
    margin: 24px 0 6px;
    padding: 16px 18px;
    background: rgba(91, 164, 230, 0.04);
    border-radius: 12px;
    border: 1.5px dashed rgba(91, 164, 230, 0.2);
    transition: all 0.3s ease;
}

.poll-toggle:hover {
    border-color: rgba(91, 164, 230, 0.35);
    background: rgba(91, 164, 230, 0.06);
}

.poll-section {
    margin: 6px 0 24px;
    padding: 22px;
    background: rgba(91, 164, 230, 0.04);
    border-radius: 12px;
    border: 1.5px solid rgba(91, 164, 230, 0.15);
    animation: fadeIn 0.35s ease-out;
}

.poll-section-title {
    margin: 0 0 16px 0;
    font-size: 1.05rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-option-row {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.poll-option-row .form-control {
    flex: 1;
}

.remove-option-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(220, 53, 69, 0.2);
    background: rgba(220, 53, 69, 0.06);
    color: #dc3545;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-option-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* 开关组件 */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 0;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 46px;
    height: 26px;
    background: #c8d6e5;
    border-radius: 13px;
    position: relative;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text);
    user-select: none;
}

/* ==========================================
   响应式布局 - 移动端适配
   ========================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    main {
        padding: 18px 0;
    }

    /* 导航栏 */
    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-content {
        padding: 10px 14px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        background: var(--glass-strong);
        backdrop-filter: blur(30px) saturate(200%);
        -webkit-backdrop-filter: blur(30px) saturate(200%);
        padding: 24px 20px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav a {
        width: 100%;
        max-width: 320px;
        padding: 14px 20px;
        font-size: 1rem;
        text-align: center;
        margin-bottom: 8px;
        opacity: 0;
        transform: translateX(30px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav.active a {
        opacity: 1;
        transform: translateX(0);
    }

    .nav.active a:nth-child(1) { transition-delay: 0.1s; }
    .nav.active a:nth-child(2) { transition-delay: 0.15s; }
    .nav.active a:nth-child(3) { transition-delay: 0.2s; }
    .nav.active a:nth-child(4) { transition-delay: 0.25s; }

    .nav a::before {
        display: none;
    }

    .nav a:hover,
    .nav a.active {
        background: var(--primary);
        color: var(--white);
        border-color: var(--primary);
        transform: translateX(0) !important;
    }

    /* 卡片 */
    .card {
        padding: 16px 14px;
        border-radius: 12px;
        margin-bottom: 14px;
    }

    .card:hover {
        transform: none;
    }

    /* 帖子列表 */
    .post-title {
        font-size: 1.05rem;
    }

    .post-meta {
        gap: 10px;
        font-size: 0.78rem;
    }

    .post-content-preview {
        font-size: 0.88rem;
    }

    /* 页面标题 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 18px;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    /* 帖子详情 */
    .post-detail {
        padding: 20px 16px;
    }

    .post-detail h1 {
        font-size: 1.3rem;
    }

    .post-detail .content {
        font-size: 0.95rem;
    }

    .post-detail .post-meta {
        font-size: 0.8rem;
        gap: 8px;
    }

    /* 投票 */
    .poll-card {
        padding: 18px 14px;
    }

    .poll-card h3 {
        font-size: 1rem;
    }

    .poll-option-label {
        padding: 12px 14px;
        gap: 10px;
    }

    .poll-option-text {
        font-size: 0.9rem;
    }

    .poll-radio {
        width: 20px;
        height: 20px;
    }

    .poll-result-header {
        font-size: 0.82rem;
    }

    .poll-bar {
        height: 8px;
    }

    .poll-toggle {
        padding: 14px;
    }

    .poll-section {
        padding: 16px 14px;
    }

    .poll-section-title {
        font-size: 0.95rem;
    }

    .toggle-slider {
        width: 42px;
        height: 24px;
    }

    .toggle-slider::after {
        width: 20px;
        height: 20px;
    }

    .toggle-switch input:checked + .toggle-slider::after {
        transform: translateX(18px);
    }

    /* 评论 */
    .comment-item {
        padding: 12px 14px;
    }

    .comment-item .content {
        font-size: 0.9rem;
    }

    /* 搜索 */
    .search-box {
        flex-direction: column;
    }

    .search-container h1 {
        font-size: 1.25rem;
    }

    /* 表单 */
    .form-control {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    textarea.form-control {
        min-height: 120px;
    }

    /* 按钮 */
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .btn-sm {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    /* 分页 */
    .pagination {
        gap: 6px;
        margin-top: 20px;
    }

    .pagination a {
        padding: 7px 12px;
        font-size: 0.85rem;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-card .number {
        font-size: 1.5rem;
    }

    .stat-card .label {
        font-size: 0.8rem;
    }

    /* 后台表格 */
    .admin-table {
        font-size: 0.85rem;
    }

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

    .admin-actions {
        flex-direction: column;
        gap: 4px;
    }

    .admin-actions .btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    /* 登录 */
    .login-container {
        margin: 40px auto;
        padding: 0 14px;
    }

    .login-container .card {
        padding: 24px 20px;
    }

    /* 后台导航 */
    .admin-menu-toggle {
        display: flex;
    }

    .admin-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        background: var(--glass-strong);
        backdrop-filter: blur(30px) saturate(200%);
        -webkit-backdrop-filter: blur(30px) saturate(200%);
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .admin-nav.active {
        transform: translateX(0);
    }

    .admin-nav a {
        width: 100%;
        max-width: 300px;
        padding: 14px 20px;
        font-size: 1rem;
        text-align: center;
        margin-bottom: 8px;
        opacity: 0;
        transform: translateX(30px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-nav.active a {
        opacity: 1;
        transform: translateX(0);
    }

    .admin-nav.active a:nth-child(1) { transition-delay: 0.1s; }
    .admin-nav.active a:nth-child(2) { transition-delay: 0.15s; }
    .admin-nav.active a:nth-child(3) { transition-delay: 0.2s; }
    .admin-nav.active a:nth-child(4) { transition-delay: 0.25s; }
    .admin-nav.active a:nth-child(5) { transition-delay: 0.3s; }

    .admin-page-header h2 {
        font-size: 1.2rem;
    }

    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-card {
        padding: 18px 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 发帖表单 */
    .post-form-container {
        padding: 0;
    }

    .post-form-container .card {
        padding: 20px 16px;
    }

    /* 页脚 */
    .footer {
        padding: 16px 0;
        font-size: 0.8rem;
    }

    /* 排名 */
    .rank-number {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .hot-badge {
        font-size: 0.72rem;
        padding: 2px 6px;
    }

    .search-box input {
        width: 100%;
    }

    .search-box .btn {
        width: 100%;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .empty-state svg {
        width: 60px;
        height: 60px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 触摸优化 */
@media (hover: none) {
    .card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav a:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .header-content {
        padding: 10px 12px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
    }
    
    .card {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .post-title {
        font-size: 1rem;
    }
    
    .post-meta {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }
    
    .post-content-preview {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }
    
    .page-header h1 {
        font-size: 1.2rem;
    }
    
    .post-detail h1 {
        font-size: 1.25rem;
    }
    
    .post-detail .content {
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card .number {
        font-size: 1.3rem;
    }
    
    .stat-card .label {
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 9px 16px;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 9px 12px;
        font-size: 0.9rem;
    }
    
    .comment-item {
        padding: 10px;
    }
    
    .rank-number {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        position: relative;
    }
    
    .header-content {
        padding: 8px 20px;
    }
    
    main {
        padding: 15px 0;
    }
}

/* 登录/登出按钮样式 */
.btn-login,
.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-login {
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary);
}

.btn-login:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 164, 230, 0.3);
}

.btn-logout {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 4px 12px;
    font-size: 13px;
}

.btn-logout:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.user-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-name:hover {
    color: var(--primary);
}

/* 作者链接样式 */
.author-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.author-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .btn-login,
    .btn-logout {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 6px;
        padding: 10px 20px;
        border-top: 1px solid var(--border);
        margin-top: 10px;
    }
    
    .user-name {
        font-size: 13px;
    }
}
