/* ===== Apple Premium Style ===== */

:root {
    /* 基础色板 - Apple 风格 */
    --bg-primary: #F5F5F7;
    --bg-card: rgba(255,255,255,0.72);
    --bg-card-solid: #FFFFFF;
    --bg-card-hover: rgba(255,255,255,0.88);
    --bg-input: rgba(255,255,255,0.64);
    --bg-tag: rgba(0,0,0,0.04);
    --bg-tag-hover: rgba(0,0,0,0.07);
    --bg-header: rgba(245,245,247,0.8);
    --bg-elevated: rgba(255,255,255,0.92);
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #86868B;
    --text-quaternary: #A1A1A6;
    --accent: #0071E3;
    --accent-light: rgba(0,113,227,0.06);
    --accent-hover: #0077ED;
    --accent-gradient: linear-gradient(135deg, #0071E3 0%, #40A9FF 100%);
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --border: rgba(0,0,0,0.06);
    --border-light: rgba(0,0,0,0.04);
    --separator: rgba(0,0,0,0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-xl: 0 24px 64px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);
    --radius: 20px;
    --radius-sm: 16px;
    --radius-xs: 12px;
    --radius-full: 999px;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --placeholder-bg: rgba(0,0,0,0.02);
    --placeholder-text: #C7C7CC;
    --chart-grid: rgba(0,0,0,0.05);
    --chart-tooltip-bg: rgba(255,255,255,0.95);
    --overlay: rgba(0,0,0,0.2);
    --hero-gradient: radial-gradient(ellipse at 50% 0%, rgba(0,113,227,0.04) 0%, transparent 60%);
    --card-accent: #0071E3;
    --avatar-gradient: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
    --code-bg: rgba(0,0,0,0.03);
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.47059;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.022em;
    overflow-x: hidden;
}

/* ===== 主内容区 ===== */
.main-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 40px 80px;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: viewIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Hero 搜索区域 ===== */
.search-hero {
    text-align: center;
    padding: 64px 40px 56px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-card-solid);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.search-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-gradient);
    pointer-events: none;
}

.hero-logo {
    position: absolute;
    top: 20px;
    left: 24px;
    height: 43px;
    width: auto;
    z-index: 1;
}

.hero-credit {
    position: absolute;
    bottom: 16px;
    right: 24px;
    font-size: 12px;
    color: var(--text-quaternary);
    z-index: 1;
    letter-spacing: -0.01em;
    font-weight: 500;
}

.search-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.041em;
    line-height: 1.08349;
    margin-bottom: 12px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.search-subtitle {
    font-size: 19px;
    line-height: 1.21053;
    color: var(--text-secondary);
    margin-top: 60px;
    margin-bottom: 4px;
    font-weight: 400;
    letter-spacing: 0.012em;
    position: relative;
    z-index: 1;
}

.search-box {
    display: flex;
    align-items: center;
    max-width: 520px;
    margin: 48px auto 28px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px 4px 4px 20px;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.04);
}

.search-box:focus-within {
    border-color: rgba(0,113,227,0.3);
    box-shadow: 0 0 0 4px rgba(0,113,227,0.08), var(--shadow);
    background: var(--bg-card-solid);
}

.search-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: var(--text-quaternary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font);
    padding: 10px 0;
    letter-spacing: -0.022em;
}

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

.search-btn {
    padding: 10px 22px;
    background: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font);
    letter-spacing: -0.01em;
}

.search-btn:hover {
    background: var(--accent-hover);
}

.search-btn:active {
    transform: scale(0.97);
}

.quick-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.quick-tag {
    padding: 8px 16px;
    background: var(--bg-tag);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    font-weight: 500;
    letter-spacing: -0.01em;
    border: none;
}

.quick-tag:hover {
    background: var(--bg-tag-hover);
    color: var(--text-primary);
}

.quick-tag:active {
    transform: scale(0.96);
}

/* ===== 搜索结果 ===== */
.results-container {
    padding-top: 4px;
}

.results-header {
    margin-bottom: 20px;
    padding: 0 4px;
}

.results-count {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.result-card {
    background: var(--bg-card-solid);
    border-radius: var(--radius-sm);
    padding: 24px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px) scale(1.005);
}

.result-card:active {
    transform: translateY(0) scale(0.995);
    box-shadow: var(--shadow);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.result-avatar {
    width: 42px;
    height: 42px;
    background: var(--avatar-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.result-code {
    font-size: 12px;
    color: var(--accent);
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'Cascadia Code', Menlo, monospace;
    font-weight: 500;
    background: var(--code-bg);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    letter-spacing: -0.01em;
}

.result-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 2px;
}

.result-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.38462;
    letter-spacing: -0.01em;
}

.result-meta-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-quaternary);
    margin-top: 1px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.25;
}

.empty-state p {
    font-size: 17px;
    color: var(--text-tertiary);
    letter-spacing: -0.022em;
    font-weight: 400;
}

/* ===== 返回按钮 ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card-solid);
    border: none;
    border-radius: var(--radius-full);
    color: var(--accent);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    letter-spacing: -0.01em;
}

.back-btn:hover {
    background: var(--accent);
    color: #FFF;
}

.back-btn:active {
    transform: scale(0.97);
}

.back-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .main-container {
        padding: 16px 20px 60px;
    }

    .search-hero {
        padding: 48px 24px 44px;
    }

    .hero-logo {
        top: 14px;
        left: 16px;
        height: 34px;
    }

    .search-title {
        font-size: 34px;
    }

    .search-subtitle {
        font-size: 17px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 20px;
    }
}
