/* ========================================
   Apple-style Design System (Light Mode)
   ======================================== */

:root {
    --bg: #F5F5F7;
    --card: #FFFFFF;
    --card-elevated: #FFFFFF;
    --text: #1D1D1F;
    --text-secondary: #86868B;
    --accent: #007AFF;
    --accent-hover: #0051D5;
    --accent-light: rgba(0, 122, 255, 0.08);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --font-base: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: "Inter", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-base);
    background: radial-gradient(circle at top, #f7fbff 0%, #eef4fc 35%, #f5f5f7 100%);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
    padding: 40px 20px 16px;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.section-title,
.summary-title,
.mode-title,
.placeholder-card h3,
.step-item strong {
    font-family: var(--font-heading);
}

h1,
.section-title {
    line-height: 1.05;
}

p,
label,
input,
select,
button,
.tip-text,
.placeholder-text {
    font-family: var(--font-base);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 8px;
    display: grid;
    gap: 0;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(520px, 1fr);
    gap: 20px;
    align-items: start;
}

.input-column,
.output-column {
    display: grid;
}

.input-column {
    position: sticky;
    top: 24px;
    align-self: start;
    z-index: 2;
}

.output-column {
    min-width: 0;
    align-self: start;
}

.title-glass {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.06) 0%, rgba(90, 200, 255, 0.04) 100%);
    border: 1px solid rgba(0, 122, 255, 0.12);
    padding: 36px 32px;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    pointer-events: none;
}

.orb-1 {
    width: 120px;
    height: 120px;
    background: var(--accent);
    top: -30px;
    right: 10%;
    animation: drift 8s ease-in-out infinite;
}

.orb-2 {
    width: 80px;
    height: 80px;
    background: #5AC8FA;
    bottom: -20px;
    left: 15%;
    animation: drift 10s ease-in-out infinite reverse;
}

.title-content {
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    border-radius: 100px;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0, 122, 255, 0.15);
}

.title-glass h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.title-glass .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

@keyframes drift {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(15px, -10px);
    }

    66% {
        transform: translate(-10px, 8px);
    }
}

.placeholder-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
    text-align: left;
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
    border: 1px solid rgba(60, 60, 67, 0.12);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
}

.placeholder-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.placeholder-card .placeholder-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
    max-width: 560px;
    margin-top: 4px;
}

.placeholder-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
}

.placeholder-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(0, 122, 255, 0.12);
    color: var(--accent);
    font-size: 24px;
}

.placeholder-steps {
    display: grid;
    gap: 16px;
}

.step-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 18px;
}

.step-mark {
    display: inline-flex;
    width: auto;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.step-item strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.step-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.loading-section {
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.loading-section .spinner {
    margin-bottom: 24px;
}

/* Cards — hover 阴影大幅弱化 */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    animation: slideUp 0.5s ease-out;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-0.5px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Title Card（替代原来的导航栏）
   ======================================== */

.title-card {
    text-align: center;
    padding: 28px 32px;
    margin-bottom: 20px;
    grid-column: 1 / -1;
}

.title-card h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}

.title-card .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* ========================================
   Step Labels（卡片内步骤序号）
   ======================================== */

.step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.step-num {
    display: inline-flex;
    width: auto;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.upload-card .step-label {
    padding: 24px 28px 0;
}

/* 按钮内的步骤序号 */
.btn-step {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    margin-right: 4px;
    flex-shrink: 0;
}

/* Settings */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row.api-key-row {
    grid-template-columns: 1fr;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

#apiKeyHint {
    margin-top: 8px;
}

.input-with-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.input-actions {
    display: inline-flex;
    gap: 8px;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

select option {
    font-size: 15px;
    padding: 8px;
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
    animation: slideUp 0.5s ease-out;
}

.mode-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-sm);
}

.mode-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.mode-card.active {
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12), var(--shadow-md);
}

.mode-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.25s ease;
}

.mode-card.active .mode-check {
    opacity: 1;
    transform: scale(1);
    background: var(--accent);
}

.mode-icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 10px;
}

.mode-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.mode-desc {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Upload Area */
.upload-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
}

.upload-placeholder {
    min-height: 120px;
    padding: 12px 28px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--card-elevated);
}

.upload-card.drag-over .upload-placeholder {
    background: rgba(0, 122, 255, 0.08);
    border: 2px dashed rgba(0, 122, 255, 0.5);
}

.upload-icon {
    color: var(--accent);
    margin-bottom: 12px;
    display: inline-flex;
    padding: 16px;
    background: var(--accent-light);
    border-radius: 50%;
}

.upload-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Upload Loading */
.upload-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 28px;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

.spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 122, 255, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.upload-loading-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Preview */
.preview-container {
    padding: 8px 24px 24px;
    animation: fadeIn 0.4s ease-out;
}

.preview-image-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg);
    max-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.preview-image-wrapper img {
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.replace-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.replace-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #007AFF, #0A84FF);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    font-family: inherit;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0051D5, #3EA9FF);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #6ea9e6, #8fc0ec);
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: var(--border-strong);
    background: rgba(0, 0, 0, 0.02);
}

.btn-inline {
    min-width: 52px;
    padding: 11px 12px;
}

.analyze-status {
    margin: -8px 0 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    min-height: 24px;
}

.analyze-status.is-ready {
    color: var(--text-secondary);
}

.analyze-status.is-warning {
    color: var(--text-secondary);
}

.analyze-status.is-error {
    color: var(--danger);
}

/* EXIF Display Card — 统一为白色卡片风格 */
.exif-display-card {
    padding: 24px;
}

.exif-display-card .section-title {
    font-size: 16px;
    margin-bottom: 20px;
}

.exif-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exif-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    white-space: normal;
    max-width: 100%;
    flex: 0 1 auto;
}

/* Loading */
.loading-section {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.4s ease-out;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 122, 255, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.9s linear infinite;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.loading-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Progress bar in loading area */
.loading-progress-track {
    width: 100%;
    max-width: 320px;
    height: 4px;
    background: rgba(0, 122, 255, 0.08);
    border-radius: 100px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #5AC8FA);
    width: 0%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.loading-stage {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    min-height: 24px;
    transition: opacity 0.3s ease;
}

.feedback-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(255, 249, 245, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
    border: 1px solid rgba(255, 59, 48, 0.14);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}

.feedback-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger);
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.feedback-card__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--danger);
}

.feedback-card__title {
    margin-bottom: 10px;
}

.feedback-card__desc {
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

.feedback-card__tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.feedback-card__tip {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 59, 48, 0.08);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.feedback-card__btn {
    margin-top: 18px;
    padding: 12px 16px;
}

.feedback-card.is-warning {
    background: linear-gradient(180deg, rgba(255, 252, 244, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(255, 149, 0, 0.16);
}

.feedback-card.is-warning .feedback-card__icon {
    background: rgba(255, 149, 0, 0.12);
    color: var(--warning);
}

.feedback-card.is-warning .feedback-card__eyebrow {
    color: var(--warning);
}

/* Summary Card */
.summary-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
}

.summary-content {
    flex: 1;
    min-width: 0;
}

.summary-header {
    margin-bottom: 12px;
}

.photo-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.summary-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    word-wrap: break-word;
}

.style-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    padding: 6px 12px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 100px;
    border: 1px solid var(--border);
}

/* Score Ring */
.score-ring-wrapper {
    flex-shrink: 0;
    padding-top: 4px;
}

.score-ring {
    position: relative;
    width: 140px;
    height: 140px;
}

.ring-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-track {
    fill: none;
    stroke: var(--bg);
    stroke-width: 10;
    stroke-linecap: round;
}

.ring-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text);
}

.ring-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Score Grid (Professional) */
.score-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 980px) {
    .score-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }

    .input-column {
        position: static;
        top: auto;
    }
}

@media (max-width: 640px) {
    .score-grid {
        grid-template-columns: 1fr;
    }

    .input-column {
        position: static;
        top: auto;
    }

    .score-ring-wrapper {
        align-self: center;
    }

    .preview-image-wrapper {
        max-height: 280px;
    }

    .preview-image-wrapper img {
        max-height: 280px;
    }

    body {
        padding: 20px 16px 12px;
    }

    .app-header h1 {
        font-size: 17px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

    .summary-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

.score-item {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.score-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.score-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.score-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.score-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 6px;
    background: var(--bg);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #5AC8FA);
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: left;
}

/* Analysis Cards (Professional) */
.analysis-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.analysis-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    transition: box-shadow 0.2s ease;
}

.analysis-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.analysis-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-card>p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.analysis-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.analysis-section h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    color: var(--text);
}

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

.analysis-section li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.analysis-section li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #007AFF;
}

.analysis-card[data-section="composition"] {
    border-left-color: #007AFF;
}

.analysis-card[data-section="composition"] .analysis-section li::before {
    background: #007AFF;
}

.analysis-card[data-section="lighting"] {
    border-left-color: #FF9500;
}

.analysis-card[data-section="lighting"] .analysis-section li::before {
    background: #FF9500;
}

.analysis-card[data-section="color"] {
    border-left-color: #FF2D55;
}

.analysis-card[data-section="color"] .analysis-section li::before {
    background: #FF2D55;
}

.analysis-card[data-section="storytelling"] {
    border-left-color: #AF52DE;
}

.analysis-card[data-section="storytelling"] .analysis-section li::before {
    background: #AF52DE;
}

.praise-card {
    padding: 24px;
    background: linear-gradient(135deg, #F2F7FF 0%, #EDF4FF 100%);
    border: 1px solid rgba(0, 122, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.praise-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.strengths-list,
.improvements-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.strengths-list li,
.improvements-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.strengths-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: -1px;
    color: var(--success);
    font-weight: 800;
    font-size: 16px;
}

.improvements-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: -1px;
    color: var(--warning);
    font-weight: 800;
    font-size: 16px;
}

/* Beginner Mode Cards */
.encouragement-card {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF5D6 100%);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.encouragement-emoji {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
}

.encouragement-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    max-width: 560px;
    margin: 0 auto;
}

.tips-card {
    padding: 24px;
    background: linear-gradient(135deg, #F0F9FF 0%, #E6F4FF 100%);
    border: 1px solid rgba(0, 122, 255, 0.12);
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 122, 255, 0.1);
}

.tip-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.tip-text {
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
    padding-top: 2px;
}

/* Section title utility */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.save-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.06) 0%, rgba(90, 200, 255, 0.04) 100%);
    border: 1px solid rgba(0, 122, 255, 0.12);
}

.save-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.save-card__desc {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.save-card__btn {
    width: auto;
    margin: 0;
    padding: 10px 20px;
    font-size: 15px;
    flex-shrink: 0;
}

.save-card__btn-icon {
    margin-right: 6px;
    vertical-align: middle;
}

.btn-inline-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border-width: 2px;
    vertical-align: middle;
}

#saveImageBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Footer — 底部空间收紧 */
.footer-quote {
    text-align: center;
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.8;
    max-width: 560px;
    margin: 10px auto 0;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.app-footer {
    text-align: center;
    padding: 12px 20px 4px;
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.8;
    letter-spacing: 0.01em;
}

/* Responsive */
@media (max-width: 980px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .input-with-actions {
        grid-template-columns: 1fr;
    }

    .input-actions {
        width: 100%;
    }

    .btn-inline {
        flex: 1;
    }

    .feedback-card {
        grid-template-columns: 1fr;
    }

    .feedback-card__icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b111d;
        --card: rgba(12, 18, 34, 0.95);
        --card-elevated: rgba(18, 26, 45, 0.96);
        --text: #F3F5F9;
        --text-secondary: #9CA5B4;
        --accent: #5AC8FF;
        --accent-hover: #3EA9FF;
        --accent-light: rgba(90, 200, 255, 0.12);
        --border: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.14);
        --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.22);
        --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.28);
        --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.32);
    }

    html {
        color-scheme: dark;
    }

    body {
        background: radial-gradient(circle at top, #111628 0%, #0d1221 36%, #07101b 100%);
    }

    .app-header,
    .card,
    .placeholder-card,
    .mode-card,
    .upload-card,
    .upload-placeholder,
    .upload-loading,
    .preview-container,
    .analysis-card,
    .score-item,
    .exif-display-card,
    .title-card,
    .title-glass,
    .save-card {
        background: var(--card);
        border-color: var(--border);
        box-shadow: var(--shadow-sm);
    }

    .app-header,
    .title-glass {
        background: rgba(10, 16, 30, 0.96);
    }

    .title-glass {
        border-color: rgba(255, 255, 255, 0.08);
    }

    .app-header {
        background: rgba(10, 16, 30, 0.96);
    }

    .card:hover,
    .mode-card:hover,
    .score-item:hover {
        box-shadow: var(--shadow-md);
    }

    .subtitle,
    .upload-hint,
    .loading-text,
    .loading-sub,
    .placeholder-text,
    .step-item p,
    .analysis-card>p,
    .analysis-section li,
    .tip-text,
    .exif-tag,
    .score-label,
    .ring-label,
    .form-group label,
    .tag {
        color: var(--text-secondary);
    }

    body,
    p,
    label,
    input,
    select,
    button,
    .tip-text,
    .placeholder-text {
        color: var(--text);
    }

    .step-item,
    .preview-image-wrapper,
    .loading-section {
        background: rgba(14, 20, 37, 0.95);
    }

    .tip-item {
        background: rgba(20, 28, 48, 0.8);
        border-color: rgba(90, 200, 255, 0.12);
    }

    .upload-card,
    .placeholder-card {
        border-color: rgba(255, 255, 255, 0.08);
    }

    .placeholder-card {
        background: linear-gradient(180deg, rgba(16, 24, 42, 0.96) 0%, rgba(18, 28, 48, 0.98) 100%);
    }

    .step-item {
        background: rgba(18, 26, 44, 0.96);
        border-color: rgba(90, 200, 255, 0.16);
    }

    .placeholder-icon {
        background: rgba(90, 200, 255, 0.14);
        color: var(--accent);
    }

    .mode-card {
        background: var(--card);
        border-color: var(--border);
    }

    .mode-card.active {
        background: rgba(10, 132, 255, 0.12);
    }

    input,
    select {
        background: rgba(12, 18, 34, 0.95);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--text);
    }

    input::placeholder,
    select option {
        color: var(--text-secondary);
    }

    .btn-primary {
        box-shadow: 0 12px 28px rgba(10, 132, 255, 0.25);
    }

    .btn-secondary {
        background: rgba(12, 18, 34, 0.95);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--text);
    }

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .replace-btn {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text);
    }

    .replace-btn:hover {
        background: rgba(255, 255, 255, 0.14);
    }

    .tips-card {
        background: linear-gradient(135deg, rgba(14, 24, 44, 0.95) 0%, rgba(18, 28, 46, 0.95) 100%);
        border-color: rgba(90, 200, 255, 0.15);
    }

    .praise-card {
        background: linear-gradient(135deg, rgba(18, 26, 44, 0.95) 0%, rgba(22, 32, 52, 0.96) 100%);
        border-color: rgba(90, 200, 255, 0.16);
    }

    .encouragement-card {
        background: linear-gradient(135deg, rgba(32, 24, 10, 0.92) 0%, rgba(40, 32, 16, 0.94) 100%);
        border-color: rgba(255, 193, 7, 0.24);
    }

    .exif-tag {
        background: rgba(16, 24, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .feedback-card {
        background: linear-gradient(180deg, rgba(44, 20, 24, 0.96) 0%, rgba(24, 18, 28, 0.98) 100%);
        border-color: rgba(255, 99, 91, 0.18);
    }

    .feedback-card__tip {
        background: rgba(20, 24, 38, 0.9);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .feedback-card.is-warning {
        background: linear-gradient(180deg, rgba(45, 32, 15, 0.95) 0%, rgba(24, 18, 28, 0.98) 100%);
        border-color: rgba(255, 184, 77, 0.18);
    }
}
