/* iOS风格蓝白配色系统 */
:root {
    --ios-blue: #007AFF;
    --ios-light-blue: #5AC8FA;
    --ios-bg: #F2F2F7;
    --ios-white: #FFFFFF;
    --ios-gray: #8E8E93;
    --ios-light-gray: #C7C7CC;
    --ios-dark: #1C1C1E;
    --ios-red: #FF3B30;
    --ios-green: #34C759;
    --ios-orange: #FF9500;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

* {
    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: var(--ios-bg);
    color: var(--ios-dark);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* 头部导航 */
.header {
    background: var(--ios-white);
    padding: 15px 20px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-dark);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ios-blue);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ios-white);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -1px 0 rgba(0,0,0,0.05);
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--ios-gray);
    font-size: 11px;
    padding: 5px 15px;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--ios-blue);
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 3px;
}

/* 卡片样式 */
.card {
    background: var(--ios-white);
    margin: 15px;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--ios-dark);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    width: 100%;
    margin: 8px 0;
}

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

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--ios-bg);
    color: var(--ios-blue);
}

.btn-danger {
    background: var(--ios-red);
    color: white;
}

.btn-success {
    background: var(--ios-green);
    color: white;
}

/* 输入框样式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--ios-light-gray);
    border-radius: 12px;
    font-size: 16px;
    background: var(--ios-white);
    transition: all 0.3s;
    outline: none;
}

.input-field:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

/* 列表样式 */
.list {
    background: var(--ios-white);
    border-radius: 16px;
    margin: 15px;
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ios-bg);
    text-decoration: none;
    color: var(--ios-dark);
    transition: background 0.2s;
}

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

.list-item:active {
    background: var(--ios-bg);
}

.list-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ios-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 15px;
    font-size: 18px;
}

.list-content {
    flex: 1;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
}

.list-subtitle {
    font-size: 14px;
    color: var(--ios-gray);
    margin-top: 2px;
}

.list-arrow {
    color: var(--ios-light-gray);
    font-size: 20px;
}

/* 用户信息卡片 */
.user-card {
    background: linear-gradient(135deg, var(--ios-blue) 0%, var(--ios-light-blue) 100%);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin: 15px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    margin-bottom: 15px;
}

.user-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-role {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.balance-display {
    background: var(--ios-white);
    border-radius: 16px;
    padding: 20px;
    margin: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.balance-label {
    font-size: 14px;
    color: var(--ios-gray);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--ios-blue);
}

/* 标签页切换 */
.tab-container {
    display: flex;
    background: var(--ios-bg);
    border-radius: 10px;
    padding: 4px;
    margin: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-gray);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--ios-white);
    color: var(--ios-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin: 15px;
    background: var(--ios-white);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--ios-bg);
}

th {
    font-weight: 600;
    color: var(--ios-gray);
    font-size: 13px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: none;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

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

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

.badge-red {
    background: rgba(255,59,48,0.1);
    color: var(--ios-red);
}

/* 提示消息 */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.alert-success {
    background: rgba(52,199,89,0.1);
    color: var(--ios-green);
    border: 1px solid rgba(52,199,89,0.2);
}

.alert-error {
    background: rgba(255,59,48,0.1);
    color: var(--ios-red);
    border: 1px solid rgba(255,59,48,0.2);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ios-gray);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.grid-item {
    background: var(--ios-white);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--ios-dark);
    transition: transform 0.2s;
}

.grid-item:active {
    transform: scale(0.98);
}

.grid-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--ios-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 24px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--ios-white);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--ios-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ios-gray);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* 响应式 */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* 签到按钮特殊样式 */
.checkin-btn {
    background: linear-gradient(135deg, var(--ios-blue) 0%, var(--ios-light-blue) 100%);
    color: white;
    font-size: 18px;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,122,255,0.4);
}

.checkin-btn:disabled {
    background: var(--ios-light-gray);
    box-shadow: none;
    cursor: not-allowed;
}

/* 卡密显示 */
.card-key {
    background: var(--ios-bg);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 1px;
    word-break: break-all;
    margin: 10px 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px;
}

.stat-item {
    background: var(--ios-white);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ios-blue);
}

.stat-label {
    font-size: 12px;
    color: var(--ios-gray);
    margin-top: 4px;
}
