/* ========================================
   皮肤投稿表单 - 白色极简主题
   ======================================== */

/* ---- CSS Variables ---- */
:root {
    --brand: #2563eb;
    --brand-light: #eff6ff;
    --brand-dark: #1d4ed8;
    --brand-rgb: 37, 99, 235;

    --bg: #f8f9fb;
    --card-bg: #ffffff;
    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-focus: #93c5fd;
    --error: #dc2626;
    --success: #16a34a;
    --warning: #d97706;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px -4px rgba(0,0,0,0.06), 0 2px 8px -4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px -8px rgba(0,0,0,0.1);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Decorative Background ---- */
.bg-decoration {
    display: none;
}

/* ---- Layout ---- */
.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 20px 60px;
}

/* ---- Header ---- */
.header {
    text-align: center;
    margin-bottom: 36px;
}

.header-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    background: var(--brand);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ---- Form Card ---- */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 40px;
    border: 1px solid var(--border);
}

/* ---- Form Sections ---- */
.form-section {
    margin-bottom: 32px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.form-section-title .icon {
    width: 28px;
    height: 28px;
    background: var(--brand-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--brand);
}

/* ---- Form Group ---- */
.form-group {
    margin-bottom: 22px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--error);
    margin-left: 2px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Text Inputs ---- */
.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
}

.form-input:hover {
    border-color: #d1d5db;
}

.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

.form-input.error {
    border-color: var(--error);
    background: #fef2f2;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: all var(--transition);
    resize: vertical;
    font-family: inherit;
}

.form-textarea:hover {
    border-color: #d1d5db;
}

.form-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

.error-message {
    display: none;
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    align-items: center;
    gap: 4px;
}

.error-message.show {
    display: flex;
}

/* ---- Phone Input Group ---- */
.phone-group {
    display: flex;
    gap: 10px;
}

.phone-group .form-input {
    flex: 1;
}

.phone-group .btn-sms {
    flex-shrink: 0;
    height: 44px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand);
    background: var(--brand-light);
    border: 1px solid #dbeafe;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    font-family: inherit;
}

.phone-group .btn-sms:hover {
    background: #dbeafe;
}

.phone-group .btn-sms:active {
    transform: scale(0.97);
}

.phone-group .btn-sms:disabled {
    color: var(--text-muted);
    background: #f3f4f6;
    border-color: var(--border);
    cursor: not-allowed;
}

/* ---- Card Radio ---- */
.card-radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card-radio-item {
    position: relative;
}

.card-radio-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 14px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
    user-select: none;
    text-align: center;
}

.card-radio-label:hover {
    border-color: #c7d2fe;
    background: #fff;
}

.card-radio-item input:checked + .card-radio-label {
    border-color: var(--brand);
    background: var(--brand-light);
}

.card-radio-icon {
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
}

.card-radio-item input:checked + .card-radio-label .card-radio-icon {
    color: var(--brand);
}

.card-radio-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.card-radio-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Toggle Switch ---- */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f9fafb;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.toggle-label-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--brand);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ---- File Upload Zone ---- */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--brand);
    background: var(--brand-light);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    background: #f0fdf4;
    padding: 16px;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
    line-height: 1;
    color: var(--text-muted);
}

.upload-zone:hover .upload-icon {
    color: var(--brand);
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-preview {
    display: none;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: #fff;
    background-image:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.upload-zone.has-file .upload-preview {
    display: block;
}

.upload-zone.has-file .upload-icon,
.upload-zone.has-file .upload-text,
.upload-zone.has-file .upload-hint {
    display: none;
}

.upload-file-name {
    display: none;
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.upload-zone.has-file .upload-file-name {
    display: block;
}

.upload-remove {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 2;
}

.upload-zone.has-file .upload-remove {
    display: flex;
}

.upload-remove:hover {
    background: var(--error);
}

/* ---- Checkbox ---- */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.checkbox-item:hover {
    background: #fff;
    border-color: #c7d2fe;
}

.checkbox-item input {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-top: 1px;
    background: #fff;
}

.checkbox-item input:checked ~ .checkbox-custom {
    background: var(--brand);
    border-color: var(--brand);
}

.checkbox-custom::after {
    content: '';
    display: none;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

.checkbox-item input:checked ~ .checkbox-custom::after {
    display: block;
}

.checkbox-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: color var(--transition);
}

.checkbox-text a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.checkbox-text a:hover {
    color: var(--brand-dark);
}

.checkbox-item.error {
    border-color: var(--error);
    background: #fef2f2;
}

/* ---- Submit Button ---- */
.form-submit-wrap {
    margin-top: 34px;
}

.btn-submit {
    width: 100%;
    height: 50px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.btn-submit:hover {
    background: var(--brand-dark);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 8px;
}

.btn-submit.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Toast Notification ---- */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }

/* ---- Footer ---- */
.footer {
    text-align: center;
    margin-top: 28px;
    padding-bottom: 20px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 28px 16px 40px;
    }

    .form-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .header h1 {
        font-size: 22px;
    }

    .header-logo {
        width: 46px;
        height: 46px;
    }

    .card-radio-group {
        grid-template-columns: 1fr;
    }

    .phone-group {
        flex-direction: column;
    }

    .phone-group .btn-sms {
        width: 100%;
    }

    .toggle-group {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
