:root {
    --primary-color: #007AFF; /* iOS Blue */
    --secondary-color: #5856D6; /* iOS Purple */
    --background-color: #F2F2F7; /* iOS Light Gray Background */
    --card-background: #FFFFFF;
    --text-primary: #1C1C1E;
    --text-secondary: #8E8E93;
    --border-radius: 16px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #000000;
        --card-background: #1C1C1E;
        --text-primary: #FFFFFF;
        --text-secondary: #8E8E93;
        --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 40px;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(28, 28, 30, 0.8);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.nav-author {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
}

@media (prefers-color-scheme: dark) {
    .nav-author {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
}

/* 头部 */
.hero {
    text-align: center;
    padding: 4rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.hero .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.author-badge {
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

/* 按钮 */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

/* Highlights Section */
.highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: -3rem; /* 负边距让卡片与 Hero 重叠，增加层次感 */
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.highlight-card {
    background: var(--card-background);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    .highlight-card {
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
}

.highlight-card:hover {
    transform: translateY(-8px);
}

.highlight-card .icon-box {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    border-radius: 16px;
}

.highlight-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.highlight-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 容器与卡片 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .card-header {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.bg-blue { background: #007AFF; }
.bg-purple { background: #5856D6; }
.bg-green { background: #34C759; }
.bg-orange { background: #FF9500; }
.bg-red { background: #FF3B30; }

/* 代码块 */
.code-block {
    background: rgba(0,0,0,0.03);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    border: 1px solid rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    .code-block {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.05);
    }
}

.code-block code {
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--primary-color);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
}

.copy-btn:hover {
    color: var(--primary-color);
}

/* 列表 */
.steps ol {
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.steps li {
    margin-bottom: 0.5rem;
}

.warning {
    color: #FF9500;
    margin-top: 1rem;
    font-size: 0.95rem;
    list-style: none;
    background: rgba(255, 149, 0, 0.1);
    padding: 0.8rem;
    border-radius: 8px;
    margin-left: -1.2rem; /* 抵消 ol padding */
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.8rem;
    font-size: 0.95rem;
}

.alert-info {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.03);
    padding: 4px;
    border-radius: 12px;
}

@media (prefers-color-scheme: dark) {
    .tabs {
        background: rgba(255,255,255,0.05);
    }
}

.tab-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--card-background);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-list {
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* 表格 */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th {
    text-align: left;
    padding: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
    th, td { border-bottom-color: rgba(255,255,255,0.05); }
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge.auto { background: rgba(52, 199, 89, 0.15); color: #34C759; }
.badge.manual { background: rgba(255, 149, 0, 0.15); color: #FF9500; }
.badge.direct { background: rgba(0, 122, 255, 0.15); color: #007AFF; }

.mt-4 { margin-top: 2rem; }

/* Accordion */
.accordion-item {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    .accordion-item { border-bottom-color: rgba(255,255,255,0.05); }
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 1rem 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
}

.accordion-header i {
    transition: transform 0.3s;
    color: var(--text-secondary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: var(--text-secondary);
    padding-right: 1rem;
}

.accordion-content p {
    padding-bottom: 1rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    color: var(--text-secondary);
}

.small {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}
