/* 信件查询页专属样式 */

.query-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 20px 60px;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 搜索区域 */
.search-section {
    background: var(--paper-color);
    padding: 50px 40px 60px;
    border-radius: 4px;
    box-shadow: -10px 10px 30px rgba(162, 142, 124, 0.1),
                 0 0 0 1px rgba(234, 221, 211, 0.5) inset;
    position: relative;
    background-image: repeating-linear-gradient(transparent, transparent 39px, var(--line-color) 39px, var(--line-color) 40px);
    background-position: 0 45px;
    margin-bottom: 40px;
    text-align: center;
}

.search-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 45px;
    height: 100%;
    width: 1px;
    background-color: rgba(255, 184, 34, 0.2);
    pointer-events: none;
}

.search-title {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 32px;
    color: var(--text-main);
    margin: 0 0 10px;
    letter-spacing: 4px;
    position: relative;
    z-index: 2;
}

.search-desc {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin: 0 0 30px;
    position: relative;
    z-index: 2;
}

.search-form {
    display: flex;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #dcd1c7;
    background: #fffdfa;
    border-radius: 4px;
    font-size: 15px;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 184, 34, 0.1);
}

.search-input::placeholder {
    color: #c7bcae;
}

.search-btn {
    padding: 14px 32px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-family: inherit;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 184, 34, 0.25);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 184, 34, 0.35);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 状态区域 */
.status-area {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* 加载状态 */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-state.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    letter-spacing: 1px;
}

/* 空状态 */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
}

.empty-state.active {
    display: flex;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 10px;
}

.empty-title {
    font-size: 18px;
    color: var(--text-main);
    font-weight: 500;
}

.empty-desc {
    font-size: 14px;
    letter-spacing: 1px;
}

/* 错误状态 */
.error-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
}

.error-state.active {
    display: flex;
}

.error-icon {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 10px;
    color: #c0392b;
}

.error-title {
    font-size: 18px;
    color: #c0392b;
    font-weight: 500;
}

.error-desc {
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.retry-btn {
    margin-top: 10px;
    padding: 10px 28px;
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* 结果列表 */
.result-section {
    display: none;
}

.result-section.active {
    display: block;
}

.result-count {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.result-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

/* 结果卡片 */
.result-card {
    background: var(--paper-color);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(180, 160, 140, 0.15);
    border: 1px solid var(--line-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(180, 160, 140, 0.15);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--line-color);
}

.card-image-placeholder {
    display: none;
}

.card-body {
    padding: 25px 30px;
}

.card-tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255, 184, 34, 0.1);
    color: var(--accent-color);
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 184, 34, 0.2);
}

.card-content {
    font-size: 15px;
    line-height: 2;
    color: var(--text-main);
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px dashed var(--line-color);
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.card-from {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-from::before {
    content: '✉';
    opacity: 0.6;
}

/* 初始提示 */
.initial-hint {
    text-align: center;
    padding: 40px 20px 20px;
    position: relative;
    z-index: 2;
}

.initial-hint p {
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 1px;
    margin: 0;
}

/* 每日限制提示 */
.daily-limit {
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
}
.daily-limit span {
    color: var(--accent-color);
    font-weight: 500;
}

/* 详情视图（替换列表） */
.detail-view {
    display: none;
    animation: fadeInUp 0.3s ease forwards;
}
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--line-color);
}
.detail-back {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}
.detail-back:hover {
    background: rgba(255, 184, 34, 0.08);
}
.detail-index {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.detail-tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255, 184, 34, 0.1);
    color: var(--accent-color);
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 20px;
    border: 1px solid rgba(255, 184, 34, 0.2);
    margin-bottom: 16px;
}
.detail-from, .detail-date {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.detail-image-wrap {
    margin: 16px 0;
    text-align: center;
}
.detail-image-wrap img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.detail-body {
    font-size: 16px;
    line-height: 2.2;
    color: var(--text-main);
    white-space: pre-wrap;
    margin: 20px 0;
    padding: 28px 24px;
    background: var(--paper-color);
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(138, 115, 95, 0.06);
    border: 1px solid var(--line-color);
    min-height: 120px;
}
.detail-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}
.detail-btn {
    padding: 10px 24px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 184, 34, 0.2);
}
.detail-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.detail-nav {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px dashed var(--line-color);
}
.nav-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-main);
    border: 1px solid #dcd1c7;
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav-btn:hover:not(:disabled) {
    background: #f6efe9;
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(74, 64, 54, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 移动端适配 */
@media (max-width: 600px) {
    .query-container {
        padding-top: 100px;
    }

    .search-section {
        padding: 35px 20px 45px;
    }

    .search-section::after {
        left: 20px;
    }

    .search-title {
        font-size: 26px;
    }

    .search-form {
        flex-direction: column;
        gap: 12px;
    }

    .search-btn {
        width: 100%;
        padding: 14px;
    }

    .card-body {
        padding: 20px;
    }

    .card-image {
        height: 180px;
    }

    .card-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
