/* 基础样式重置与设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础字体和颜色设置 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
    padding-bottom: 3rem;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 搜索区域样式 */
.search-container {
    display: flex;
    padding: 1.5rem 0;
    align-items: flex-start;
}

.search-icon {
    color: #ef4444;
    margin-right: 0.5rem;
    margin-top: 0.25rem;
    font-size: 1.2rem;
}

.search-content {
    flex: 1;
    width: 100%;
}

.search-hint {
    display: block;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 0.25rem 0 0 0.25rem;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5);
}

.search-btn {
    background-color: #ec4899;
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.search-btn:hover {
    background-color: #db2777;
}

/* 主内容区样式 */
.main-content {
    padding-bottom: 2rem;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 卡片通用样式 */
.form-card, .list-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease-in-out;
}

.form-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 卡片头部样式 */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.card-header .icon {
    margin-right: 0.5rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* 表单样式 */
.submission-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    resize: vertical;
    font-size: 1rem;
    font-family: inherit;
}

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

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.submit-btn {
    width: 100%;
    background-color: #f97316;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease-in-out;
}

.submit-btn:hover {
    background-color: #ea580c;
}

/* 列表样式 */
.submissions-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
    gap: 0.75rem;
    display: flex;
    flex-direction: column;
}

/* 隐藏滚动条但保留功能 */
.submissions-list::-webkit-scrollbar {
    display: none;
}

.submissions-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.submission-item {
    padding: 0.75rem;
    border: 1px solid #f3f4f6;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.submission-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background-color: rgba(59, 130, 246, 0.05);
    cursor: pointer;
}

.submission-title {
    font-weight: 500;
    color: #1f2937;
    word-wrap: break-word;
}

.submission-meta {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submission-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* 状态提示样式 */
.no-submissions, .loading, .error-message {
    padding: 2.5rem 0;
    text-align: center;
    color: #6b7280;
}

.no-submissions .icon, .loading .icon, .error-message .icon {
    margin-bottom: 0.75rem;
    font-size: 3rem;
    opacity: 0.3;
}

.no-submissions p, .loading p, .error-message p {
    font-size: 1rem;
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示框样式 - 修复显示问题 */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: none; /* 默认完全隐藏 */
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    z-index: 1000; /* 确保在最上层 */
    transition: opacity 0.3s, transform 0.3s;
}

/* 显示提示框时的样式 */
.toast.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* 成功提示框 */
.success-toast {
    background-color: #10b981;
    color: white;
}

/* 错误提示框 */
.error-toast {
    background-color: #ef4444;
    color: white;
}

/* 通用隐藏类 */
.hidden {
    display: none !important;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .form-card, .list-card {
        padding: 1rem;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
    }
}
