/* ============================================================
   iPhone 18 Series — Future Unfolds
   纯手写样式（无 Tailwind / 无框架）
   设计语言：深空蓝 + 钛金属，玻璃拟态，极简苹果风
   ============================================================ */

:root {
    --navy-900: #060B19;
    --navy-800: #0B132B;
    --navy-700: #1C2541;
    --ti-100: #FFFFFF;
    --ti-200: #E0E1DD;
    --ti-300: #C0C0C0;
    --ti-400: #8D99AE;
    --emerald-400: #34D399;
    --emerald-500: #10B981;

    --max-w: 80rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--navy-900);
    color: var(--ti-200);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

::selection {
    background: var(--ti-300);
    color: var(--navy-900);
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
}

.container {
    width: 100%;
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-apple {
    fill: currentColor;
    stroke: none;
}

/* ---------- Glass / Text effects ---------- */
.glass {
    background: rgba(11, 19, 43, 0.65);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(224, 225, 221, 0.15);
}

.glass-hover {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.glass-hover:hover {
    border-color: rgba(224, 225, 221, 0.4);
    box-shadow: 0 0 25px rgba(141, 153, 174, 0.15);
}

.titanium-text {
    background: linear-gradient(135deg, #FFFFFF 0%, #E0E1DD 50%, #8D99AE 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-glow {
    text-shadow: 0 0 20px rgba(224, 225, 221, 0.4);
}

/* ---------- Announcement Bar ---------- */
.announce-bar {
    background: linear-gradient(90deg, var(--navy-800), var(--navy-700), var(--navy-800));
    border-bottom: 1px solid rgba(141, 153, 174, 0.2);
    padding: 0.625rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

@media (min-width: 768px) {
    .announce-bar {
        font-size: 0.875rem;
    }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(11, 19, 43, 0.65);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(141, 153, 174, 0.1);
}

.header-inner {
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand .icon-apple {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--ti-100);
}

.brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
    color: var(--ti-100);
}

.main-nav {
    display: none;
    align-items: center;
    gap: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ti-400);
}

.main-nav a {
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--ti-100);
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
    }
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(141, 153, 174, 0.3);
    background: rgba(11, 19, 43, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ti-200);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
    border-color: var(--ti-200);
    color: var(--ti-100);
}

.lang-btn .icon-globe {
    color: var(--ti-400);
}

/* ---------- Language Switcher Dropdown ---------- */
.lang-switcher {
    position: relative;
}

.lang-btn .icon-chevron {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--ti-400);
    transition: transform 0.25s ease;
}

.lang-switcher.is-open .icon-chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 11rem;
    list-style: none;
    margin: 0;
    padding: 0.375rem;
    border-radius: 0.875rem;
    background: rgba(11, 19, 43, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(224, 225, 221, 0.18);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 50;
}

.lang-switcher.is-open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ti-300);
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-option:hover {
    background: rgba(141, 153, 174, 0.15);
    color: var(--ti-100);
}

.lang-option.is-active {
    background: rgba(224, 225, 221, 0.12);
    color: var(--ti-100);
    font-weight: 700;
}

[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-option {
    text-align: right;
}

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] body {
    text-align: right;
}

[dir="rtl"] .footer-brand {
    flex-direction: row-reverse;
}

[dir="rtl"] .toast {
    right: auto;
    left: 1.5rem;
}

[dir="rtl"] .modal-close {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .toast-icon {
    flex-direction: row-reverse;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--ti-100);
    color: var(--navy-900);
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-ghost {
    color: var(--ti-200);
    font-weight: 600;
}

.btn-ghost:hover {
    color: #fff;
    border-color: var(--ti-200);
}

.btn-block {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
}

.btn-solid {
    background: var(--ti-100);
    color: var(--navy-900);
}

.btn-solid:hover {
    background: #fff;
}

.btn-gradient {
    background: linear-gradient(90deg, #FFFFFF, #C0C0C0);
    color: var(--navy-900);
}

.btn-gradient:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ---------- Hero ---------- */
.page {
    flex: 1;
}

.hero {
    position: relative;
    padding: 5rem 0 4rem;
    overflow: hidden;
    background: radial-gradient(circle at 50% 30%, rgba(28, 37, 65, 0.6) 0%, rgba(6, 11, 25, 1) 70%);
}

@media (min-width: 768px) {
    .hero {
        padding: 8rem 0 6rem;
    }
}

.hero-inner {
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ti-200);
    border-color: rgba(141, 153, 174, 0.3);
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .hero-tag {
        font-size: 0.875rem;
    }
}

.pulse-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--emerald-400);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ti-100);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-desc {
    max-width: 42rem;
    margin: 0 auto 2.5rem;
    font-size: 1rem;
    color: var(--ti-400);
    line-height: 1.7;
}

@media (min-width: 768px) {
    .hero-desc {
        font-size: 1.25rem;
    }
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
    }
}

.hero-media {
    position: relative;
    max-width: 56rem;
    margin: 4rem auto 0;
}

.hero-media-glow {
    position: absolute;
    inset: -0.25rem;
    border-radius: 1.5rem;
    background: linear-gradient(90deg, rgba(224, 225, 221, 0.2), rgba(28, 37, 65, 0.4), rgba(141, 153, 174, 0.2));
    filter: blur(24px);
    opacity: 0.5;
}

.hero-img {
    position: relative;
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid rgba(141, 153, 174, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
    .hero-img {
        height: 500px;
    }
}

/* ---------- Sections ---------- */
.section {
    padding: 5rem 0;
}

.section-head {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--ti-100);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 3rem;
    }
}

.section-subtitle {
    color: var(--ti-400);
    max-width: 36rem;
    margin-inline: auto;
}

/* ---------- Model Grid ---------- */
.model-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .model-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.model-card {
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.model-card-featured {
    border-color: rgba(224, 225, 221, 0.3);
}

.model-img {
    width: 100%;
    height: 14rem;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(141, 153, 174, 0.1);
    transition: opacity 0.3s ease;
}

.badge-fold {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-full);
    background: var(--ti-100);
    color: var(--navy-900);
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.model-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ti-100);
    margin-bottom: 0.5rem;
}

.model-desc {
    font-size: 0.75rem;
    color: var(--ti-400);
    margin-bottom: 1rem;
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.color-picker {
    margin-bottom: 1.5rem;
}

.color-label {
    display: block;
    font-size: 0.75rem;
    color: var(--ti-400);
    margin-bottom: 0.5rem;
}

.color-dots {
    display: flex;
    gap: 0.75rem;
}

.color-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--dot, #ccc);
    border: 2px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.1);
}

.color-dot.is-active {
    border-color: var(--ti-200);
}

.model-card-bottom {
    margin-top: auto;
}

.model-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ti-100);
    margin-bottom: 1rem;
}

.price-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ti-400);
}

/* ---------- Compare ---------- */
.compare-panel {
    border-radius: 1.5rem;
    padding: 2rem;
    overflow-x: auto;
}

@media (min-width: 768px) {
    .compare-panel {
        padding: 3rem;
    }
}

.compare-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ti-100);
    text-align: center;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .compare-title {
        font-size: 2.25rem;
    }
}

.table-scroll {
    overflow-x: auto;
}

.spec-table {
    width: 100%;
    min-width: 600px;
    text-align: left;
    font-size: 0.875rem;
    color: var(--ti-200);
    border-collapse: collapse;
}

.spec-table thead tr {
    border-bottom: 1px solid rgba(141, 153, 174, 0.2);
}

.spec-table th {
    padding-bottom: 1rem;
    font-weight: 600;
    color: var(--ti-400);
    white-space: nowrap;
}

.spec-table .th-highlight {
    color: var(--ti-100);
}

.spec-table tbody tr {
    border-bottom: 1px solid rgba(141, 153, 174, 0.1);
}

.spec-table tbody tr:last-child {
    border-bottom: none;
}

.spec-table td {
    padding: 1rem 0.5rem 1rem 0;
    vertical-align: top;
}

.spec-label {
    font-weight: 500;
    color: var(--ti-400);
    white-space: nowrap;
}

.spec-highlight {
    color: var(--ti-100);
    font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid rgba(141, 153, 174, 0.1);
    padding: 3rem 0;
    background: var(--navy-900);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--ti-400);
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand .icon-apple {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--ti-200);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--ti-200);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(6, 11, 25, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 28rem;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border-color: rgba(224, 225, 221, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.is-open .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--ti-400);
    transition: color 0.2s ease;
    display: inline-flex;
}

.modal-close:hover {
    color: #fff;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ti-100);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.75rem;
    color: var(--ti-400);
    margin-bottom: 1.5rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ti-200);
    margin-bottom: 0.25rem;
}

.form-field input {
    width: 100%;
    background: var(--navy-800);
    border: 1px solid rgba(141, 153, 174, 0.3);
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--ti-100);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-field input::placeholder {
    color: rgba(141, 153, 174, 0.7);
}

.form-field input:focus {
    border-color: var(--ti-200);
}

.form-field input[readonly] {
    opacity: 0.85;
}

.btn-submit {
    padding: 0.875rem 1rem;
    margin-top: 0.5rem;
    border-radius: 0.75rem;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    color: var(--ti-100);
    transform: translateY(5rem);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-400);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon .icon {
    width: 1rem;
    height: 1rem;
}

.toast-title {
    font-weight: 700;
    font-size: 0.875rem;
}

.toast-desc {
    font-size: 0.75rem;
    color: var(--ti-400);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
