/* 全局样式 */
:root {
    --primary-color: #1e88e5;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #4caf50;
    --error-color: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

/* 导航栏 */
header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--secondary-color);
}

/* 认证页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    transition: transform 0.3s ease;
}

.auth-box:hover {
    transform: translateY(-5px);
}

.auth-box h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.auth-box h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #3498db;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    background: white;
}

.form-control::placeholder {
    color: #95a5a6;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.remember-me label {
    color: #7f8c8d;
    cursor: pointer;
}

.btn-primary {
    background: #3498db;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.auth-links p {
    margin: 10px 0;
    color: #7f8c8d;
}

.auth-links a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.flash {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    animation: slideDown 0.4s ease;
}

.flash.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash.info {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式布局 */
@media (max-width: 768px) {
    .auth-box {
        padding: 30px 20px;
    }

    .auth-box h2 {
        font-size: 24px;
    }

    .form-control {
        font-size: 15px;
        padding: 10px 12px;
    }

    .btn-primary {
        padding: 12px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 15px;
    }

    .auth-box {
        padding: 25px 15px;
    }

    .auth-box h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .remember-me input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* 首页样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
}

.search-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-select select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    min-width: 150px;
}

.search-button {
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.announcement-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.notice-type {
    background-color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.875rem;
}

.card-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    margin-bottom: 0.5rem;
}

.detail-item label {
    color: #666;
    margin-right: 0.5rem;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-outline {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 发布表单样式 */
.publish-form {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.publish-form h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: normal;
}

.form-section {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
}

.form-section h3 {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    margin: -1rem -1rem 1rem -1rem;
    padding: 0.75rem 1rem;
    background: #f0f2f5;
    border-bottom: 1px solid #eee;
}

.form-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.form-group label {
    width: 120px;
    padding: 0.5rem 1rem 0.5rem 0;
    text-align: right;
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.form-group .input-wrapper {
    flex: 1;
    min-width: 0; /* 防止flex子项溢出 */
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.form-control:hover {
    border-color: #40a9ff;
}

.form-control:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

/* 调整下拉框样式 */
select.form-control {
    appearance: none;
    padding-right: 24px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E") no-repeat right 8px center;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* 必填标记 */
.required::after {
    content: '*';
    color: #ff4d4f;
    margin-left: 4px;
    font-family: SimSun, sans-serif;
}

/* 文本编辑器区域 */
.editor-wrapper {
    flex: 1;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    background: white;
}

.rich-editor {
    padding: 1rem;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
    color: #333;
    background: white;
}

.rich-editor:focus {
    outline: none;
}

/* 编辑器内容格式化样式 */
.rich-editor b, .rich-editor strong {
    font-weight: bold;
}

.rich-editor i, .rich-editor em {
    font-style: italic;
}

.rich-editor u {
    text-decoration: underline;
}

.rich-editor ul {
    list-style-type: disc;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.rich-editor ol {
    list-style-type: decimal;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.rich-editor li {
    margin-bottom: 0.5em;
}

.rich-editor[contenteditable="true"]:empty:before {
    content: '请输入说明内容...';
    color: #999;
}

/* 文件上传区域 */
.file-upload {
    flex: 1;
}

.upload-area {
    border: 1px dashed #d9d9d9;
    background: white;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #40a9ff;
}

.upload-hint i {
    color: #40a9ff;
}

/* 表单底部操作区 */
.form-actions {
    margin-top: 2rem;
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.btn {
    height: 32px;
    padding: 0 15px;
    font-size: 0.875rem;
    border-radius: 2px;
    transition: all 0.3s;
}

.btn-primary {
    color: #fff;
    background: #1890ff;
    border: none;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.12);
    box-shadow: 0 2px 0 rgba(0,0,0,0.045);
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-outline {
    color: #595959;
    border: 1px solid #d9d9d9;
    background: white;
}

.btn-outline:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

/* 编辑器工具栏 */
.editor-toolbar {
    padding: 0.5rem;
    border-bottom: 1px solid #d9d9d9;
    background: #fafafa;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.toolbar-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    background: none;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #595959;
    font-size: 0.875rem;
}

.toolbar-btn:hover {
    background-color: #e6f7ff;
    border-color: #91d5ff;
    color: #1890ff;
}

.toolbar-btn.active {
    background-color: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

.toolbar-btn:active {
    background-color: #bae7ff;
}

.toolbar-separator {
    width: 1px;
    height: 16px;
    background-color: #d9d9d9;
    margin: 0 0.5rem;
}

/* 工具栏按钮激活状态优化 */
.toolbar-btn.active {
    background-color: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

.toolbar-btn:active {
    background-color: #bae7ff;
}

/* 管理后台样式 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.admin-nav {
    display: flex;
    gap: 1rem;
}

.admin-nav a {
    padding: 0.5rem 1rem;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
}

.admin-nav a:hover {
    color: #1890ff;
    background: #e6f7ff;
}

.admin-nav a.active {
    color: #1890ff;
    background: #e6f7ff;
    font-weight: 500;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
    background: #fafafa;
    font-weight: 500;
    color: #333;
}

.admin-table tr:hover {
    background: #fafafa;
}

.status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    font-size: 0.875rem;
}

.status.active {
    background: #e6f7ff;
    color: #1890ff;
}

.status.expired {
    background: #fff1f0;
    color: #f5222d;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s;
}

.btn-icon:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid #d9d9d9;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
}

.page-link:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.page-link.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 用户角色标签 */
.status.admin {
    background: #f6ffed;
    color: #52c41a;
}

.status.user {
    background: #e6f7ff;
    color: #1890ff;
}

/* 用户管理表格样式 */
.admin-table td {
    vertical-align: middle;
}

.admin-table .table-actions {
    justify-content: flex-end;
}

/* 公示详情页样式 */
.announcement-detail {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.detail-header h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.detail-header .meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: #666;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    color: #666;
    font-size: 0.875rem;
}

.content-box {
    padding: 1rem;
    background: #fafafa;
    border-radius: 4px;
    line-height: 1.6;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #fafafa;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.attachment-item:hover {
    background: #f0f0f0;
}

.attachment-item .filename {
    flex: 1;
}

.attachment-item .filesize {
    color: #666;
    font-size: 0.875rem;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.captcha-container input {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
}

#captcha-image {
    height: 46px;
    width: 140px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

#captcha-image:hover {
    border-color: #40a9ff;
}

/* Footer Styles */
.site-footer {
    background-color: #ffffff;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.footer-section {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.footer-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.footer-section h4 {
    color: #1e88e5;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: #1e88e5;
}

.footer-section p {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: #555;
}

.footer-section a {
    color: #1e88e5;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #1565c0;
}

/* 友情链接样式 */
.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    background: #f8f9fa;
    color: #555;
    transition: all 0.2s;
}

.footer-links a:hover {
    background: #e3f2fd;
    color: #1e88e5;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-section {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }
}
