/* Apple Rental Platform - Apple Style CSS */
/* 极简、克制、优雅的 Apple 设计风格 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1d1d1f;
    --secondary-color: #86868b;
    --background-color: #ffffff;
    --card-background: #fbfbfd;
    --border-color: #d2d2d7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --link-color: #0066cc;
    --success-color: #34c759;
    --warning-color: #ff9500;
    --error-color: #ff3b30;
    --radius: 12px;
    --radius-lg: 18px;
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    min-height: 100vh;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==================== Header ==================== */
.header {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 48px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

.logo {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
}

.nav-links a:hover {
    opacity: 1;
}

/* ==================== Tab Bar ==================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 9999;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 20px;
    transition: color 0.2s ease;
}

.tab-item.active {
    color: var(--link-color);
}

.tab-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    stroke-width: 1.5;
}

/* ==================== Main Content ==================== */
.main-content {
    padding-top: 48px;
    padding-bottom: 70px;
    min-height: 100vh;
}

/* ==================== Category Section ==================== */
.category-section {
    padding: 32px 0 24px;
}

.category-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.007em;
    line-height: 1.14286;
    padding: 0 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ==================== Product Grid - 强制4列 ==================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 20px;
}

/* ==================== Product Card ==================== */
.product-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f7 100%);
    padding: 12px;
}

.product-card-info {
    padding: 12px;
    text-align: center;
}

.product-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.016em;
    line-height: 1.28577;
}

.product-card-price {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.022em;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-width: 28px;
    white-space: nowrap;
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--link-color);
    color: #fff;
}

.btn-primary:hover {
    background: #0077ed;
}

.btn-secondary {
    background: transparent;
    color: var(--link-color);
    border: 1px solid var(--link-color);
}

.btn-secondary:hover {
    background: var(--link-color);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* ==================== Form Elements ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.form-input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 17px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    color: var(--text-primary);
}

.form-input:focus {
    border-color: var(--link-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

/* ==================== Option Selection ==================== */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.option-item {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 980px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    color: var(--text-primary);
}

.option-item:hover {
    border-color: var(--text-secondary);
}

.option-item.selected {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ==================== Bottom Bar ==================== */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.12);
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
}

.bottom-bar-price {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.bottom-bar-price small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ==================== Page Title ==================== */
.page-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.004em;
    line-height: 1.125;
    padding: 20px;
    color: var(--text-primary);
}

/* ==================== Card ==================== */
.card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 16px 20px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ==================== List ==================== */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 0.5px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: none;
}

/* ==================== Status Badge ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(255, 149, 0, 0.12);
    color: #b25000;
}

.status-success {
    background: rgba(52, 199, 89, 0.12);
    color: #248a3d;
}

.status-error {
    background: rgba(255, 59, 48, 0.12);
    color: #d70015;
}

.status-info {
    background: rgba(0, 102, 204, 0.12);
    color: #0055b3;
}

/* ==================== Loading ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 17px;
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: calc(100% - 40px);
    max-width: 400px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 0.5px solid var(--border-color);
}

/* ==================== Progress Steps ==================== */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active::after {
    background: var(--link-color);
}

.progress-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.progress-step.active .progress-step-dot {
    background: var(--link-color);
}

.progress-step.completed .progress-step-dot {
    background: var(--success-color);
}

.progress-step-label {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== Risk Check Animation ==================== */
.risk-check {
    text-align: center;
    padding: 80px 20px;
}

.risk-check-icon {
    width: 100px;
    height: 100px;
    border: 3px solid var(--border-color);
    border-top-color: var(--link-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 32px;
}

.risk-check-text {
    font-size: 17px;
    color: var(--text-secondary);
}

/* ==================== Utilities ==================== */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }

/* Hide scrollbar but keep functionality */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ==================== Responsive - 保持4列不变 ==================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .product-grid {
        gap: 10px;
        padding: 0 16px;
    }

    .product-card-info {
        padding: 10px 8px;
    }

    .product-card-name {
        font-size: 12px;
    }

    .product-card-price {
        font-size: 11px;
    }

    .category-title {
        font-size: 24px;
        padding: 0 16px;
    }

    .header-inner {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        gap: 8px;
        padding: 0 12px;
    }

    .product-card-image {
        padding: 8px;
    }

    .product-card-info {
        padding: 8px 6px;
    }

    .product-card-name {
        font-size: 11px;
    }

    .product-card-price {
        font-size: 10px;
    }

    .category-title {
        font-size: 21px;
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .category-section {
        padding: 24px 0 20px;
    }
}

@media (max-width: 360px) {
    .product-grid {
        gap: 6px;
        padding: 0 10px;
    }

    .product-card-info {
        padding: 6px 4px;
    }

    .product-card-name {
        font-size: 10px;
    }

    .product-card-price {
        font-size: 9px;
    }
}
