/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus {
    outline: none !important;
}

*:focus-visible {
    outline: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.header {
    background: #2d3436;
    color: #fff;
    padding: 36px 0 32px;
    text-align: center;
}

.header h1 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.header p {
    font-size: 1em;
    opacity: 0.7;
    font-weight: 400;
}

/* ===== Nav ===== */
.nav-bar {
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-bar .container {
    display: flex;
    gap: 0;
    padding: 0 20px;
}

.nav-bar a {
    text-decoration: none;
    color: #636e72;
    font-size: 14px;
    font-weight: 500;
    padding: 14px 24px;
    border-bottom: 2px solid transparent;
    transition: all 0.25s;
    letter-spacing: 0.3px;
}

.nav-bar a:hover,
.nav-bar a.active {
    color: #2d3436;
    border-bottom-color: #2d3436;
}

/* ===== Card ===== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 30px;
    margin: 24px 0;
    border: 1px solid #eef0f4;
}

.card h2 {
    font-size: 1.15em;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

.card h3 {
    font-size: 1em;
    color: #555;
    margin: 14px 0 8px;
    font-weight: 600;
}

/* ===== Sample Image ===== */
.sample-wrapper {
    margin: 16px 0;
}

.sample-wrapper .sample-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.sample-image {
    max-width: 280px;
    border-radius: 8px;
    border: 1px solid #eef0f4;
    overflow: hidden;
    background: #fafafa;
}

.sample-image img {
    width: 100%;
    height: auto;
    display: block;
}

.sample-image .sample-placeholder {
    aspect-ratio: 9/16;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6fa;
    color: #b2bec3;
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

/* ===== Requirements ===== */
.requirements {
    background: #f8f9fd;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 14px 0;
}

.requirements h4 {
    color: #636e72;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.requirements ul {
    list-style: none;
    padding: 0;
}

.requirements ul li {
    font-size: 13px;
    color: #636e72;
    padding: 3px 0 3px 16px;
    position: relative;
}

.requirements ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #b2bec3;
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #636e72;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #eef0f4;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.25s;
    background: #fafbfc;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: #2d3436;
    background: #fff;
}

.contact-input-wrapper {
    display: flex;
    gap: 10px;
}

.contact-input-wrapper input {
    flex: 1;
}

.contact-hint {
    font-size: 12px;
    color: #b2bec3;
    margin-top: 4px;
}

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed #dfe6e9;
    border-radius: 10px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: #fafbfc;
    margin: 14px 0;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #2d3436;
    background: #f5f6fa;
}

.upload-zone .upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: #eef0f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #636e72;
    transition: background 0.25s;
}

.upload-zone:hover .upload-icon {
    background: #dfe6e9;
}

.upload-zone p {
    color: #b2bec3;
    font-size: 13px;
}

.upload-zone .upload-count {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin: 8px 0;
}

/* ===== Preview Grid ===== */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    border: 1.5px solid #eef0f4;
    background: #fafbfc;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-item .img-wrap {
    position: relative;
    aspect-ratio: 9/16;
    width: 100%;
    overflow: hidden;
    background: #f5f6fa;
}

.preview-item .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-item .group-input {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid #eef0f4;
    border-top: none;
    font-size: 12px;
    text-align: center;
    transition: border-color 0.25s;
    font-family: inherit;
    border-radius: 0 0 6px 6px;
    background: #fff;
}

.preview-item .group-input:focus {
    border-color: #2d3436;
    outline: none;
}

.preview-item .group-input.error {
    border-color: #d63031;
    background: #fff5f5;
}

.preview-item .group-input::placeholder {
    color: #b2bec3;
    font-size: 11px;
}

.preview-item .remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(45,52,54,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    transition: background 0.2s;
    font-family: inherit;
}

.preview-item .remove-btn:hover {
    background: #d63031;
}

.preview-item .img-index {
    position: absolute;
    bottom: 3px;
    left: 3px;
    background: rgba(45,52,54,0.7);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.3px;
    font-family: inherit;
}

.btn-primary {
    background: #2d3436;
    color: #fff;
}

.btn-primary:hover {
    background: #1a1e20;
}

.btn-primary:disabled {
    background: #b2bec3;
    cursor: not-allowed;
}

.btn-success {
    background: #00b894;
    color: #fff;
}

.btn-success:hover {
    background: #00a381;
}

.btn-danger {
    background: #d63031;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

/* ===== Progress Bar ===== */
.progress-bar {
    display: none;
    margin: 14px 0;
}

.progress-bar.active {
    display: block;
}

.progress-bar .progress-track {
    width: 100%;
    height: 6px;
    background: #eef0f4;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: #2d3436;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

.progress-bar .progress-text {
    font-size: 12px;
    color: #b2bec3;
    margin-top: 6px;
    text-align: center;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45,52,54,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-box .success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: #e8f8f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #00b894;
}

.modal-box .error-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: #fce8e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #d63031;
}

.modal-box h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-box .query-code {
    font-size: 28px;
    font-weight: 700;
    color: #2d3436;
    letter-spacing: 3px;
    padding: 12px;
    background: #f5f6fa;
    border-radius: 8px;
    margin: 14px 0;
    user-select: all;
    font-family: "SF Mono", "Fira Code", monospace;
}

.modal-box p {
    color: #636e72;
    margin-bottom: 6px;
    font-size: 13px;
}

.modal-box .btn {
    margin-top: 14px;
}

/* ===== Query Page ===== */
.query-result {
    display: none;
    margin-top: 18px;
}

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

.status-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-pending {
    background: #fef3e2;
    color: #e17055;
    border: 1px solid #fde2c3;
}

.status-approved {
    background: #e8f8f5;
    color: #00b894;
    border: 1px solid #b2dfdb;
}

.status-rejected {
    background: #fce8e8;
    color: #d63031;
    border: 1px solid #f5c6c6;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 28px 0;
    color: #b2bec3;
    font-size: 12px;
}

/* ===== Alert / Toast ===== */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 13px;
    animation: fadeIn 0.25s ease;
}

.alert-info {
    background: #f0f4ff;
    border: 1px solid #d5ddf5;
    color: #3867d6;
}

.alert-warning {
    background: #fef9e7;
    border: 1px solid #fdebd0;
    color: #e17055;
}

.alert-error {
    background: #fce8e8;
    border: 1px solid #f5c6c6;
    color: #d63031;
}

.alert-success {
    background: #e8f8f5;
    border: 1px solid #b2dfdb;
    color: #00b894;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .header { padding: 28px 0 24px; }
    .header h1 { font-size: 1.35em; }
    .card { padding: 20px; }
    .preview-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .nav-bar .container { overflow-x: auto; }
    .nav-bar a { padding: 12px 16px; font-size: 13px; white-space: nowrap; }
    .modal-box { padding: 24px; }
    .modal-box .query-code { font-size: 22px; letter-spacing: 2px; }
    .sample-image { max-width: 200px; }
}
