/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* 主要内容区 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.welcome-section h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.welcome-section p {
    color: #666;
    font-size: 1.1rem;
}

/* 公示卡片 */
.announcement-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid #3498db;
}

.announcement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.announcement-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    flex: 1;
}

.category {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.category.general {
    background: #e8f4fc;
    color: #3498db;
}

.category.notice {
    background: #ffeaa7;
    color: #e17055;
}

.category.news {
    background: #a29bfe;
    color: white;
}

.announcement-meta {
    display: flex;
    gap: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.announcement-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.announcement-content {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.read-more:hover {
    background: #2980b9;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #bdc3c7;
}

/* 登录页面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
}

.login-container {
    background: white;
    border-radius: 10px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s;
}

.login-form input:focus {
    border-color: #3498db;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    background: #2980b9;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.login-footer a {
    color: #3498db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* 管理后台样式 */
.admin-header {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-new {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-new:hover {
    background: #219653;
}

.admin-content {
    display: grid;
    gap: 2rem;
}

.announcement-editor {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.announcement-editor h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    font-weight: 600;
    color: #2c3e50;
}

tbody tr:hover {
    background: #f8f9fa;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
    transition: all 0.3s;
}

.btn-action.edit {
    background: #3498db;
    color: white;
}

.btn-action.edit:hover {
    background: #2980b9;
}

.btn-action.delete {
    background: #e74c3c;
    color: white;
}

.btn-action.delete:hover {
    background: #c0392b;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.published {
    background: #d5f4e6;
    color: #27ae60;
}

.status.draft {
    background: #fef9e7;
    color: #f39c12;
}

/* Quill编辑器定制 */
.ql-toolbar {
    border-radius: 6px 6px 0 0 !important;
    border-color: #e0e0e0 !important;
}

.ql-container {
    border-radius: 0 0 6px 6px !important;
    border-color: #e0e0e0 !important;
    font-size: 1rem;
}

/* 页脚 */
footer {
    background: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

footer p {
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav a {
        margin: 0 5px;
    }
    
    .announcement-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/*上传文件*/
/* 附件上传样式 */
.attachment-upload {
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
}

.btn-attachment {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-attachment:hover {
    background-color: #45a049;
}

.attachment-info {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    margin-bottom: 15px;
}

.attachments-list {
    margin-top: 15px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 8px;
}

.attachment-info-col {
    display: flex;
    align-items: center;
    flex: 1;
}

.attachment-icon {
    margin-right: 10px;
    color: #4CAF50;
    font-size: 18px;
}

.attachment-name {
    font-weight: 500;
    margin-right: 10px;
}

.attachment-size {
    color: #666;
    font-size: 12px;
}

.btn-remove-attachment {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-attachment:hover {
    background-color: #ffebee;
    border-radius: 50%;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.upload-status {
    font-size: 12px;
    margin-top: 5px;
    color: #666;
}