/* =============================================
   广广小助手 — iOS 拟物风公共样式
   ============================================= */

/* ---- Design Tokens ---- */
:root {
    /* iOS Modern Colors */
    --ios-bg: #f5f5f7;
    --ios-bg2: #ececed;
    --ios-surface: rgba(255, 255, 255, 0.82);
    --ios-separator: rgba(0, 0, 0, 0.08);

    /* Text System */
    --text-primary: #1d1d1f;
    --text-secondary: #48484a;
    --text-tertiary: #86868b;
    --text-link: #0071e3;

    /* Vibrant Brand Colors */
    --blue: #007aff;
    --green: #34c759;
    --orange: #ff9500;
    --red: #ff3b30;
    --purple: #af52de;
    --pink: #ff2d55;
    --teal: #5ac8fa;
    --indigo: #5856d6;
    --yellow: #ffcc00;

    /* Glassmorphism Utilities */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: 20px;

    /* Shadows — more subtle and layered */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

    --shadow-card:
        0 0 0 0.5px rgba(0, 0, 0, 0.05),
        0 2px 10px rgba(0, 0, 0, 0.04);

    --shadow-card-hover:
        0 0 0 0.5px rgba(0, 0, 0, 0.06),
        0 10px 30px rgba(0, 0, 0, 0.1);

    --shadow-icon:
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    /* Radii */
    --radius-icon: 20px;
    --radius-card: 22px;
    --radius-sm: 12px;
    --radius-full: 999px;

    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        "Helvetica Neue", Arial, sans-serif;
    background: var(--ios-bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

img {
    display: block;
}

::selection {
    background: rgba(0, 122, 255, 0.2);
}

/* ---- iOS Navigation Bar ---- */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 56px;
    background: rgba(249, 249, 252, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid var(--ios-separator);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.nav-bar .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.nav-logo img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-logo-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.nav-spacer {
    flex: 1;
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(118, 118, 128, 0.12);
    border-radius: 10px;
    padding: 7px 12px;
    width: 220px;
    transition: width var(--transition);
}

.nav-search:focus-within {
    width: 280px;
}

.nav-search svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.nav-search input {
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.nav-search input::placeholder {
    color: var(--text-tertiary);
}

/* ---- iOS App Icon (Skeuomorphic) ---- */
.app-icon {
    position: relative;
    border-radius: var(--radius-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-icon);
    flex-shrink: 0;
    transition: transform var(--transition-spring), box-shadow var(--transition);
}

/* Top gloss shine */
.app-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.38) 0%,
            rgba(255, 255, 255, 0.10) 60%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: var(--radius-icon) var(--radius-icon) 60% 60% / var(--radius-icon) var(--radius-icon) 30% 30%;
    pointer-events: none;
    z-index: 2;
}

.app-icon img {
    position: relative;
    z-index: 1;
}

/* Icon gradient presets */
.icon-blue {
    background: linear-gradient(145deg, #409eff, #007aff, #0062cc);
}

.icon-indigo {
    background: linear-gradient(145deg, #7e80e6, #5856d6, #3634a3);
}

.icon-purple {
    background: linear-gradient(145deg, #c56cee, #af52de, #8944b2);
}

.icon-pink {
    background: linear-gradient(145deg, #ff638a, #ff2d55, #d60041);
}

.icon-red {
    background: linear-gradient(145deg, #ff6961, #ff3b30, #c0392b);
}

.icon-orange {
    background: linear-gradient(145deg, #ffb142, #ff9500, #cc7700);
}

.icon-yellow {
    background: linear-gradient(145deg, #ffe066, #ffcc00, #d4a800);
}

.icon-green {
    background: linear-gradient(145deg, #5de079, #34c759, #248a3d);
}

.icon-teal {
    background: linear-gradient(145deg, #7eddff, #5ac8fa, #0071a4);
}

.icon-cyan {
    background: linear-gradient(145deg, #65d8e6, #32ade6, #007292);
}

.icon-brown {
    background: linear-gradient(145deg, #b07060, #a2845e, #7f5539);
}

/* ---- iOS Badge / Tag ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-blue {
    background: rgba(0, 122, 255, 0.1);
    color: var(--blue);
}

.badge-green {
    background: rgba(52, 199, 89, 0.12);
    color: var(--green);
}

.badge-gray {
    background: rgba(142, 142, 147, 0.12);
    color: var(--text-secondary);
}

.badge-orange {
    background: rgba(255, 149, 0, 0.12);
    color: var(--orange);
}

/* ---- Toast ---- */
.toast-wrap {
    position: fixed;
    bottom: 32px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    background: rgba(28, 28, 30, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    padding: 13px 18px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    animation: toastSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

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

/* ---- Progress Sheet ---- */
.progress-sheet {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.3s ease;
}

.progress-sheet.open {
    background: rgba(0, 0, 0, 0.4);
    pointer-events: all;
}

.progress-sheet-inner {
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 28px 28px 48px;
    width: 100%;
    max-width: 560px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
}

.progress-sheet.open .progress-sheet-inner {
    transform: translateY(0);
}

.progress-handle {
    width: 36px;
    height: 4px;
    background: rgba(60, 60, 67, 0.2);
    border-radius: 2px;
    margin: 0 auto 24px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* ---- Responsive Breakpoints ---- */
@media (max-width: 768px) {
    .nav-search {
        display: none;
    }
    
    .nav-bar {
        padding: 0 16px;
    }

    .toast-wrap {
        right: 50%;
        transform: translateX(50%);
        bottom: 40px;
        align-items: center;
        width: 100%;
        padding: 0 20px;
    }

    .toast-item {
        max-width: 100%;
        text-align: center;
    }

    .progress-sheet-inner {
        padding: 24px 20px 40px;
    }
}

@media (max-width: 480px) {
    .nav-logo-text {
        font-size: 15px;
    }
    
    .nav-meta-info {
        display: none;
    }
}