/* 全局样式 */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: #f7f8fa;
    padding-bottom: 70px;
    color: #1a1a1a;
    line-height: 1.5;
    /* 防止页面闪烁 */
    opacity: 0;
    transition: opacity 0.2s ease;
}

body.loaded {
    opacity: 1;
}

.page { 
    min-height: 100vh; 
    padding: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

/* 按钮样式 */
.btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.5px;
}

.btn:active { 
    opacity: 0.85;
    transform: scale(0.98);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-plain {
    background: transparent;
    color: #07c160;
    border: 1.5px solid #07c160;
}

.btn-plain:active {
    background: rgba(7, 193, 96, 0.05);
}

.btn-small {
    padding: 10px 18px;
    font-size: 14px;
    display: inline-block;
    width: auto;
    border-radius: 10px;
}

.btn-gray {
    background: #f5f5f5;
    color: #666;
}

/* 输入框样式 */
input, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #07c160;
    background: #fff;
}

input::placeholder, textarea::placeholder {
    color: #bbb;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 0.5px solid #e5e5e5;
    display: flex;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-item.active { 
    color: #07c160;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: block;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.skeleton-btn {
    height: 48px;
    border-radius: 12px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 加载提示 */
.loading {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
}

.empty {
    text-align: center;
    padding: 48px 24px;
    color: #999;
    font-size: 14px;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 文字省略 */
.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}
