/* =========================================================
   泰东物流签收单查询系统 - 前台样式
   移动优先，纯原生 CSS，无外部依赖
   ========================================================= */

:root {
    --primary: #1a56db;
    --primary-dark: #1544ad;
    --primary-light: #e8f0fe;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --border: #e5e7eb;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
        "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary); text-decoration: none; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- 头部 ---------- */
.site-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 28px 0 36px;
    text-align: center;
}

.site-header h1 {
    margin: 0 0 6px;
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.site-header p {
    margin: 0;
    opacity: 0.85;
    font-size: 14px;
}

/* ---------- 搜索区 ---------- */
.search-panel {
    max-width: 640px;
    margin: -26px auto 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 18px;
    position: relative;
    z-index: 2;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1 1 200px;
    min-width: 0;
    padding: 13px 16px;
    font-size: 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s;
}

.search-form input[type="text"]:focus {
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    transition: background .15s, transform .05s;
    white-space: nowrap;
}

.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(0.98); }
.btn.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: #b91c1c; }
.btn.btn-secondary { background: #6b7280; }
.btn.btn-secondary:hover { background: #4b5563; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.search-hint {
    margin: 10px 2px 0;
    font-size: 12.5px;
    color: var(--text-sub);
}

/* ---------- 结果区 ---------- */
.results-wrap {
    max-width: 1200px;
    margin: 28px auto 60px;
    padding: 0 16px;
}

.results-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    margin-bottom: 18px;
}

.results-summary .count {
    font-size: 15px;
}

.results-summary .count b {
    color: var(--primary);
    font-size: 20px;
    margin: 0 4px;
}

.results-summary .mark-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

.empty-state, .no-query-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sub);
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state .icon, .no-query-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 560px) {
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 800px) {
    .photo-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
    .photo-grid { grid-template-columns: repeat(5, 1fr); }
}

.photo-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.photo-card .thumb-box {
    aspect-ratio: 1 / 1;
    background: #eef1f5;
    overflow: hidden;
}

.photo-card .thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-card .meta {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-sub);
}

.photo-card .meta .container-no {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    font-size: 12.5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 26px 0;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    color: var(--text-main);
    font-size: 14px;
}

.page-btn.current {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.page-btn.disabled {
    color: #cbd5e1;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--text-sub);
}

/* ---------- 灯箱 Lightbox ---------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    flex-direction: column;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay .lb-img-wrap {
    max-width: 100%;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
    background: #111;
}

.lightbox-overlay .lb-info {
    color: #eee;
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
}

.lightbox-overlay .lb-info .mark { color: #fff; font-weight: 700; }

.lb-controls {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 8px;
}

.lb-btn {
    pointer-events: auto;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lb-btn:hover { background: rgba(255,255,255,0.25); }

.lb-close {
    position: absolute;
    top: 14px;
    right: 14px;
    pointer-events: auto;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,0.25); }

.lb-download {
    pointer-events: auto;
    color: #fff;
    background: rgba(255,255,255,0.12);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 10px;
    display: inline-block;
}
.lb-download:hover { background: rgba(255,255,255,0.25); }

/* ---------- 页脚 ---------- */
.site-footer {
    text-align: center;
    color: var(--text-sub);
    font-size: 12.5px;
    padding: 20px 0 40px;
}

/* ---------- 加载动画 ---------- */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
