/* BBS系统样式表 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #660099;
    --primary-light: #8B5CF6;
    --secondary: #52A85A;
    --accent: #E8913A;
    --info: #4A90D9;
    --danger: #EF4444;
    --success: #10B981;
    --bg: #FAFAFA;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #E8E0EC;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(102, 0, 153, 0.1);
    --shadow-hover: 0 4px 16px rgba(102, 0, 153, 0.15);
}

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

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

/* Header */
header {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: var(--primary);
    color: var(--white);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

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

.btn-secondary {
    background: var(--info);
    color: var(--white);
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    opacity: 0.9;
}

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

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

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

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Topic Status */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-current {
    background: var(--secondary);
    color: var(--white);
}

.status-past {
    background: var(--text-lighter);
    color: var(--text);
}

.status-upcoming {
    background: var(--accent);
    color: var(--white);
}

/* Post Meta */
.post-meta {
    display: flex;
    gap: 16px;
    color: var(--text-lighter);
    font-size: 12px;
    margin: 8px 0;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
}

.badge-pinned {
    background: var(--accent);
    color: var(--white);
}

.badge-homework {
    background: var(--info);
    color: var(--white);
}

.badge-poll {
    background: var(--primary);
    color: var(--white);
}

/* Forms */
.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;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 0, 153, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.flash-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--success);
}

.flash-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

/* Poll Styles */
.poll-question {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.poll-option:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.poll-option input[type="radio"] {
    margin-right: 12px;
    accent-color: var(--primary);
}

.poll-option-voted {
    background: rgba(102, 0, 153, 0.05);
    border-color: var(--primary);
}

.poll-vote-count {
    margin-left: auto;
    color: var(--text-lighter);
    font-weight: 500;
}

/* Replies */
.replies {
    margin-top: 24px;
}

.reply {
    background: var(--bg);
    border-left: 3px solid var(--primary);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 0 8px 8px 0;
}

.reply-ai {
    border-left-color: var(--accent);
    background: linear-gradient(135deg, #FFF7ED 0%, #FAFAFA 100%);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reply-author {
    font-weight: 600;
    color: var(--primary);
}

.reply-ai .reply-author {
    color: var(--accent);
}

.reply-time {
    color: var(--text-lighter);
    font-size: 12px;
}

/* AI Characters */
.ai-characters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.ai-character {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.ai-character:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.ai-character-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ai-character-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 8px;
}

.ai-character-title {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 12px;
}

.ai-character-description {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.6;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

table thead {
    background: var(--bg);
}

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

table th {
    font-weight: 600;
    color: var(--text);
}

table tbody tr:hover {
    background: var(--bg);
}

/* Notifications */
.notification {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
}

.notification.unread {
    background: linear-gradient(135deg, #F3E8FF 0%, var(--white) 100%);
    border-left: 4px solid var(--primary);
}

.notification-icon {
    font-size: 24px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.notification-text {
    color: var(--text-light);
    font-size: 14px;
}

.notification-time {
    color: var(--text-lighter);
    font-size: 12px;
}

/* Footer */
footer {
    background: var(--white);
    border-top: 2px solid var(--border);
    padding: 24px 0;
    margin-top: 48px;
    text-align: center;
}

footer p {
    color: var(--text-light);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .nav {
        gap: 12px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .ai-characters {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.hidden { display: none !important; }
