﻿* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: #4299e1; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { font-size: 1.15rem; font-weight: 700; color: #2d3748; }
.nav a { margin-left: 1rem; color: #4a5568; font-size: 0.9rem; }

/* Main */
.main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* Cards */
.card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Hero */
.hero { text-align: center; padding: 2rem 0; }
.hero h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero-desc { color: #718096; margin-bottom: 2rem; }

/* Create card */
.create-card { max-width: 480px; margin: 0 auto 2rem; text-align: left; }

/* Forms */
.form { width: 100%; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.9rem; }
.input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d2d6dc;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: #4299e1; box-shadow: 0 0 0 2px rgba(66,153,225,0.2); }
.hint { display: block; font-size: 0.8rem; color: #a0aec0; margin-top: 0.25rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #d2d6dc;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    color: #2d3748;
    transition: all 0.15s;
    text-decoration: none;
}
.btn:hover { background: #f7fafc; text-decoration: none; }
.btn-primary { background: #4299e1; color: #fff; border-color: #4299e1; }
.btn-primary:hover { background: #3182ce; }
.btn-success { background: #48bb78; color: #fff; border-color: #48bb78; }
.btn-success:hover { background: #38a169; }
.btn-warning { background: #ecc94b; color: #2d3748; border-color: #ecc94b; }
.btn-warning:hover { background: #d69e2e; }
.btn-secondary { background: #edf2f7; color: #2d3748; border-color: #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fff5f5; color: #c53030; border-color: #feb2b2; }
.btn-danger:hover { background: #fed7d7; border-color: #fc8181; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-group { display: flex; gap: 0.75rem; margin-top: 1rem; }

/* Status */
.status { display: inline-block; padding: 0.15rem 0.5rem; font-size: 0.75rem; border-radius: 3px; font-weight: 500; }
.status-uploaded { background: #fefcbf; color: #975a16; }
.status-parsed { background: #c6f6d5; color: #22543d; }
.status-packaged { background: #bee3f8; color: #2a4365; }
.status-error { background: #fed7d7; color: #9b2c2c; }

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    gap: 0.5rem;
}
.page-header h1 { font-size: 1.35rem; font-weight: 700; }
.breadcrumb { width: 100%; font-size: 0.85rem; color: #718096; margin-top: 0.25rem; }
.breadcrumb a { color: #4299e1; }
.project-name-badge {
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 0.1rem;
}
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Drop zone */
.drop-zone {
    border: 2px dashed #d2d6dc;
    border-radius: 6px;
    padding: 2.5rem;
    text-align: center;
    color: #718096;
    cursor: pointer;
    transition: all 0.15s;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: #4299e1;
    background: #ebf8ff;
}
.file-list { margin-top: 0.75rem; }
.file-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: #f7fafc;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}
.upload-actions { margin-top: 1rem; }

/* Progress */
.progress-bar { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; margin-top: 0.75rem; overflow: hidden; }
.progress-fill { height: 100%; background: #4299e1; border-radius: 3px; transition: width 0.3s; width: 0%; }
.post-upload { margin-top: 1.5rem; }
.parse-progress { margin-top: 1rem; }
.parse-progress p { margin-bottom: 0.5rem; }

/* Preview grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.photo-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}
.photo-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}
.photo-thumb img:hover { transform: scale(1.03); }
.photo-fields { padding: 0.75rem; }
.field-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.field-row label { font-size: 0.8rem; color: #718096; min-width: 2.5rem; flex-shrink: 0; }
.field-input {
    flex: 1;
    padding: 0.3rem 0.5rem;
    border: 1px solid #d2d6dc;
    border-radius: 3px;
    font-size: 0.85rem;
}
.field-input:focus { outline: none; border-color: #4299e1; }
.field-missing { color: #e53e3e; font-size: 0.75rem; font-weight: 500; }
.filepath-preview small { color: #a0aec0; font-size: 0.75rem; word-break: break-all; }
.gps-info small { color: #48bb78; font-size: 0.75rem; }
.photo-actions {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 0.5rem;
}

/* Detail page */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.detail-image img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Info rows */
.info-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.info-row .label { font-size: 0.85rem; color: #718096; min-width: 5rem; }
.info-row .value { font-size: 0.9rem; font-weight: 500; }
.path-preview { color: #4299e1; font-family: monospace; font-size: 0.85rem; }

/* OCR section */
.ocr-section { margin-top: 1rem; }
.ocr-section h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.ocr-section h3 small { font-weight: 400; color: #718096; }
.ocr-text {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    color: #4a5568;
}

.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }

/* Banners */
.banner {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.banner-warning { background: #fffff0; border: 1px solid #ecc94b; color: #975a16; }
.banner-success { background: #f0fff4; border: 1px solid #48bb78; color: #22543d; }
.banner-success a { margin-left: 0.5rem; }

/* Similar site name detection panel */
.similar-panel { background:#fff; border:1px solid #90cdf4; border-radius:8px; padding:1rem; margin-bottom:1.5rem; }
.similar-panel-header { display:flex; justify-content:space-between; align-items:center; font-weight:600; color:#2b6cb0; margin-bottom:.75rem; }
.similar-group { background:#f8fafc; border:1px solid #bee3f8; border-radius:6px; padding:.75rem 1rem; margin-bottom:.5rem; }
.similar-group:last-child { margin-bottom:0; }
.similar-group.sg-ignored { opacity:.5; }
.similar-group-top { display:flex; justify-content:space-between; align-items:flex-start; gap:.5rem; margin-bottom:.5rem; }
.similar-variants { display:flex; flex-direction:column; gap:.4rem; flex:1; }
.site-variant { background:#ebf8ff; border:1px solid #90cdf4; border-radius:4px; padding:3px 8px; font-size:.85rem;
                color:#2b6cb0; cursor:pointer; transition:background .15s; }
.site-variant:hover { background:#bee3f8; }
.btn-ghost { background:transparent; border:1px solid #cbd5e0; color:#718096; }
.btn-ghost:hover { background:#edf2f7; }
.similar-merge { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.merge-label { white-space:nowrap; font-size:.9rem; color:#4a5568; }
.similar-name-input { flex:1; min-width:0; max-width:100%; }


/* Empty states */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem; color: #718096; }

/* Loading */
.loading { text-align: center; color: #a0aec0; padding: 1rem; }
.empty { text-align: center; color: #a0aec0; padding: 1rem; }

/* Job list */
.job-list { margin-top: 1rem; }
.job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.job-info strong { margin-right: 0.75rem; }
.job-info small { color: #a0aec0; font-size: 0.8rem; margin-left: 0.5rem; }
.job-actions { display: flex; gap: 0.35rem; }

/* Errors */
.error-msg { color: #e53e3e; font-size: 0.85rem; margin-top: 0.5rem; }

/* Existing jobs section */
.existing-jobs { text-align: left; max-width: 580px; margin: 2rem auto; }
.existing-jobs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.existing-jobs-header h2 { font-size: 1.1rem; margin: 0; }

/* Responsive */
@media (max-width: 768px) {
    .preview-grid { grid-template-columns: 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .header-actions { width: 100%; }
    .main { padding: 1rem; }
}

.similar-panel-header { font-size:1.1rem; font-weight:700; }
.similar-panel-header span { font-size:1rem; }
.similar-variants .site-variant { font-size:.95rem; }
.sg-ignore-btn { font-size:.9rem; }
.merge-label { font-size:.95rem; font-weight:600; }
.similar-name-input { font-size:.95rem; }

.status-parsing { background:#fefcbf; color:#975a16; font-weight:600; }

#similarGroups > .similar-group:nth-child(odd) { background:#f0f9ff; border-left:3px solid #60a5fa; }
#similarGroups > .similar-group:nth-child(even) { background:#fefce8; border-left:3px solid #facc15; }
