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

:root {
    --primary: #007AFF;
    --success: #34C759;
    --danger: #FF3B30;
    --warning: #FF9500;
    --bg: #F2F2F7;
    --card-bg: #FFFFFF;
    --text: #000000;
    --text-secondary: #8E8E93;
    --border: #E5E5EA;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 60px;
}

.hidden {
    display: none !important;
}

/* Header */
.header {
    background: var(--card-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.header h1, .header h2 {
    font-size: 20px;
    font-weight: 600;
}

.vehicle-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-size: 14px;
    max-width: 150px;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.stat-card {
    background: var(--card-bg);
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 15px 15px;
}

.action-btn {
    background: var(--card-bg);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.action-btn span {
    font-size: 18px;
}

/* Recent Records */
.recent-records {
    padding: 15px;
}

.recent-records h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.record-item {
    background: var(--card-bg);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.record-icon.energy { background: #E3F2FD; }
.record-icon.maintenance { background: #FFF3E0; }
.record-icon.insurance { background: #E8F5E9; }
.record-icon.daily { background: #F3E5F5; }
.record-icon.violation { background: #FFEBEE; }

.record-detail h4 {
    font-size: 14px;
    font-weight: 500;
}

.record-detail p {
    font-size: 12px;
    color: var(--text-secondary);
}

.record-amount {
    font-size: 16px;
    font-weight: 600;
}

.record-amount.income { color: var(--success); }
.record-amount.expense { color: var(--danger); }

/* Record Tabs */
.record-tabs {
    display: flex;
    overflow-x: auto;
    background: var(--card-bg);
    padding: 10px 15px;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 8px 16px;
    border: none;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

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

.record-list {
    padding: 15px;
}

/* Charts */
.charts-container {
    padding: 15px;
}

.chart-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.chart-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.chart-card canvas {
    max-height: 200px;
}

/* Stats Detail */
.stats-detail {
    padding: 15px;
}

.stats-detail h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.detail-item {
    background: var(--card-bg);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-value {
    font-weight: 600;
}

/* Vehicle List */
.vehicle-list {
    padding: 15px;
}

.vehicle-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
}

.vehicle-item h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.vehicle-item p {
    font-size: 13px;
    color: var(--text-secondary);
}

.vehicle-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

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

/* Settings */
.settings-list {
    padding: 15px;
}

.setting-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: none;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
}

.setting-item.danger {
    color: var(--danger);
}

.setting-item span {
    font-size: 18px;
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    display: flex;
    border-top: 1px solid var(--border);
    padding: 8px 0;
    z-index: 100;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.tab-item.active {
    color: var(--primary);
}

.tab-icon {
    font-size: 20px;
}

.tab-label {
    font-size: 10px;
}

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

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 17px;
}

.close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

/* Form */
#record-form, #vehicle-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-top: 10px;
}

/* Auth 登录/注册页面 */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}

.logo {
    font-size: 80px;
    margin-bottom: 20px;
}

.auth-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.tagline {
    color: #8E8E93;
    margin-bottom: 40px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background: #E5E5EA;
    border-radius: 10px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.auth-tab.active {
    background: white;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 16px;
    margin-bottom: 15px;
    border: 1px solid #E5E5EA;
    border-radius: 10px;
    font-size: 16px;
}

.auth-tip {
    margin-top: 15px;
    color: #FF3B30;
    font-size: 14px;
    min-height: 20px;
}

.logout-btn {
    background: #FF3B30;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Header 用户名显示 */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user span {
    font-size: 14px;
    color: #8E8E93;
}
