/* 继承工具编辑器的基础样式 */
@import '../tools/style.css';

/* 返回按钮 */
.header-nav {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #e0e0e0;
    transform: translateX(-2px);
}

.icon-back::before {
    content: '←';
    margin-right: 8px;
    font-size: 16px;
}

/* 公告卡片 */
.announcement-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.announcement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.announcement-card.pinned {
    border-left: 4px solid #4CAF50;
}

/* 公告头部 */
.announcement-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.publisher-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.publisher-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.publisher-name {
    font-weight: 500;
    margin-right: 8px;
    color: #333;
}

.publisher-role {
    font-size: 0.8em;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.publish-time {
    color: #999;
    font-size: 0.9em;
}

/* 公告内容 */
.announcement-title {
    font-size: 1.2em;
    margin: 0 0 10px 0;
    color: #333;
}

.announcement-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #444;
    margin-bottom: 15px;
}

/* 附件列表 */
.attachments-list {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    background: #f9f9f9;
}

.attachment-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.attachment-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.attachment-item:last-child {
    margin-bottom: 0;
}

.attachment-info {
    flex: 1;
    margin-right: 10px;
}

.attachment-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.attachment-size {
    font-size: 0.8em;
    color: #666;
}

/* 编辑表单 */
.announcement-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.announcement-form.active {
    display: block;
}

.announcement-form h2 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

/* 表单控件 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* 按钮样式 */
.form-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

.form-buttons button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-buttons button[type="submit"] {
    background: #4CAF50;
    color: white;
}

.form-buttons button[type="submit"]:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.form-buttons button[type="button"] {
    background: #f5f5f5;
    color: #333;
}

.form-buttons button[type="button"]:hover {
    background: #e0e0e0;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* 添加按钮 */
.add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

/* 上传进度条 */
.upload-progress {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.progress-text {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    width: 0;
    transition: width 0.3s ease;
}

.progress-percent {
    text-align: right;
    font-size: 12px;
    color: #666;
}

/* 图片预览 */
.preview {
    margin-top: 10px;
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 附件操作按钮 */
.btn-remove-attachment {
    color: #f44336;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    transition: opacity 0.2s ease;
}

.btn-remove-attachment:hover {
    opacity: 0.8;
}

.btn-add-attachment {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-add-attachment:hover {
    background: #eee;
    border-color: #4CAF50;
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}
