:root {
    --primary-color: #007AFF;
    --secondary-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --bg-color: #F2F2F7;
    --card-bg: #FFFFFF;
    --text-main: #1C1C1E;
    --text-secondary: #3A3A3C;
    --text-light: #8E8E93;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --radius-lg: 12px;
    --radius-md: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 70px;
    font-size: 14px;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 340px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    font-size: 18px;
    font-weight: 700;
    padding: 20px 24px 10px;
    text-align: center;
}

.modal-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 10px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 10px 24px 24px;
    background: var(--card-bg);
}

.modal-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.modal-btn.confirm {
    background: var(--primary-color);
    color: white;
}

/* 统一交互动画 */
.resource-item, .tutorial-item, .rank-item, .menu-item {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.resource-item:active, .tutorial-item:active, .rank-item:active, .menu-item:active {
    transform: scale(0.97);
    background-color: #f8f8f8;
}

/* 渐显加载动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container > section, .container > div {
    animation: fadeIn 0.4s ease-out forwards;
}

/* 按钮统一反馈 */
button, .tab-item, .modal-btn {
    transition: opacity 0.2s, transform 0.2s;
}

button:active, .tab-item:active, .modal-btn:active {
    opacity: 0.7;
    transform: scale(0.95);
}

.container {
    padding: 0 15px;
}

/* 顶部搜索 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-color);
    padding: 10px 15px;
}

.search-bar {
    background: var(--white);
    height: 44px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: var(--shadow);
}

.search-bar i {
    color: var(--text-light);
    margin-right: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    background: transparent;
}

/* 底部导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    height: 100%;
    font-weight: normal;
}

.tab-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-item span {
    font-weight: normal;
}

/* 共通按钮 */
.btn-download {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-download:active {
    transform: scale(0.95);
}
