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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f0 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.header {
    background: linear-gradient(90deg, #1e3a8a, #3730a3);
    color: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo a {
    color: #fff;
    text-decoration: none;
}

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

.nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.user-box {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-box a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    transition: all 0.3s;
}

.user-box a:hover {
    background: rgba(255, 255, 255, 0.3);
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #1e3a8a;
    margin-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.post-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.post-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: bold;
    color: #1f2937;
    font-size: 15px;
}

.post-time {
    color: #9ca3af;
    font-size: 13px;
}

.post-content {
    color: #374151;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 12px;
}

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

.post-images img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.post-actions {
    display: flex;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.action-btn {
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
}

.action-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.action-btn.liked {
    color: #ef4444;
}

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

.btn-primary {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

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

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

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

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.auth-container {
    max-width: 420px;
    margin: 60px auto;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-title {
    text-align: center;
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 25px;
}

.sms-row {
    display: flex;
    gap: 10px;
}

.sms-row .form-input {
    flex: 1;
}

.sms-btn {
    padding: 10px 16px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.sms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #6b7280;
    font-size: 14px;
}

.auth-footer a {
    color: #3b82f6;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 30px 20px;
    text-align: center;
    margin-top: 50px;
}

.footer a {
    color: #d1d5db;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
}

.footer a:hover {
    color: #fff;
}

.footer-copyright {
    margin-top: 10px;
    font-size: 13px;
}

.comment-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

.comment-item {
    padding: 10px 0;
    border-bottom: 1px solid #f9fafb;
}

.comment-item:last-child {
    border-bottom: none;
}

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

.comment-username {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.comment-time {
    color: #9ca3af;
    font-size: 12px;
}

.comment-content {
    color: #374151;
    font-size: 14px;
    padding-left: 40px;
}

.question-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.question-number {
    color: #3b82f6;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
}

.question-text {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 20px;
    line-height: 1.7;
}

.options-list {
    list-style: none;
}

.option-item {
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.option-item.selected {
    border-color: #3b82f6;
    background: #dbeafe;
}

.option-item.correct {
    border-color: #10b981;
    background: #d1fae5;
}

.option-item.wrong {
    border-color: #ef4444;
    background: #fee2e2;
}

.explanation {
    margin-top: 15px;
    padding: 15px;
    background: #fef3c7;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
}

.ai-chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.ai-message.user .message-avatar {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.ai-message .message-content {
    background: #f3f4f6;
    color: #374151;
}

.ai-message.user .message-content {
    background: #3b82f6;
    color: #fff;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.chat-input-area textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.tool-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s;
}

.tool-card:hover {
    transform: translateY(-3px);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
    color: #fff;
}

.tool-name {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.tool-desc {
    font-size: 13px;
    color: #6b7280;
}

.calc-result {
    margin-top: 15px;
    padding: 15px;
    background: #dbeafe;
    border-radius: 8px;
    color: #1e40af;
    font-size: 15px;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    color: #fff;
    text-align: center;
    margin-bottom: 25px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    border: 4px solid rgba(255, 255, 255, 0.5);
}

.profile-nickname {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

.profile-meta {
    font-size: 14px;
    opacity: 0.9;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #1f2937;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-menu-title {
    padding: 10px 20px;
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-menu-item {
    display: block;
    padding: 12px 20px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.admin-menu-item:hover {
    background: #374151;
    color: #fff;
}

.admin-menu-item.active {
    background: #3b82f6;
    color: #fff;
}

.admin-main {
    flex: 1;
    padding: 25px 30px;
    overflow-x: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-title {
    font-size: 22px;
    color: #1f2937;
    font-weight: bold;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f9fafb;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.banned {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .nav {
        display: none;
    }
}
