/* 延吉卷烟厂班车系统 - 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #1890ff;
    --primary-dark: #096dd9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text: #1A1B1C;
    --text-secondary: #6B7280;
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e8e8e8;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* 页面容器 */
.page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.header .subtitle {
    font-size: 12px;
    opacity: 0.9;
    text-align: center;
    margin-top: 2px;
}

/* 卡片 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

/* 按钮 */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

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

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

.btn-primary:active {
    background: var(--primary-dark);
}

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

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

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
}

/* 线路列表 */
.line-list {
    padding: 0 12px;
}

.line-item {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

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

.line-item .line-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.line-item .line-info {
    flex: 1;
    min-width: 0;
}

.line-item .line-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.line-item .line-desc {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-item .line-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    flex-shrink: 0;
    margin-left: 8px;
}

.line-status.running {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success);
}

.line-status.offline {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(250, 173, 20, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(255, 77, 79, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(24, 144, 255, 0.1);
    color: var(--primary);
}

/* 信息展示行 */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--text-secondary);
    font-size: 13px;
}

.info-row .value {
    font-weight: 600;
    font-size: 14px;
}

/* 大数字展示 */
.big-number {
    text-align: center;
    padding: 16px 0;
}

.big-number .number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.big-number .unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.big-number .desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 底部固定按钮 */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 16px;
    background: white;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 100;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.empty .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 首页入口卡片 */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 40px 20px 60px;
    text-align: center;
}

.hero h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero p {
    font-size: 14px;
    opacity: 0.9;
}

.entrance-cards {
    padding: 0 16px;
    margin-top: -30px;
}

.entrance-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.entrance-card:active {
    transform: scale(0.98);
}

.entrance-card .icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 16px;
    flex-shrink: 0;
}

.entrance-card .icon.driver {
    background: rgba(24, 144, 255, 0.1);
}

.entrance-card .icon.passenger {
    background: rgba(82, 196, 26, 0.1);
}

.entrance-card .info h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.entrance-card .info p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 脉冲动画（定位中） */
.pulse {
    position: relative;
}

.pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
    transform: translate(-50%, -50%);
    animation: pulse 1.5s ease-out infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* 地图容器 */
#map-container {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 300px;
}

/* 底部信息面板 */
.info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 16px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    z-index: 50;
}

.info-panel .station-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-panel .stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 12px;
}

.info-panel .stat-item {
    text-align: center;
}

.info-panel .stat-item .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.info-panel .stat-item .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}
