/* Tesla风格主题CSS */
:root {
    --tesla-red: #e31e24;
    --tesla-red-dark: #c51e24;
    --tesla-red-light: #ff4444;
    --tesla-blue: #1976d2;
    --tesla-green: #28a745;
    --tesla-orange: #ff9800;
    --light-bg: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --text-secondary: #495057;
    --border-color: #dee2e6;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 2.5em;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1em;
    font-weight: 400;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-dark);
    border-color: var(--tesla-green);
}

.card h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.card h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 500;
}

/* API Selection Cards */
.api-grid {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.api-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    text-align: center;
}

.api-card:first-child {
    border-color: var(--tesla-green);
}

.api-card:first-child:hover {
    border-color: var(--tesla-green);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.2);
}

.api-card:last-child {
    border-color: var(--tesla-blue);
}

.api-card:last-child:hover {
    border-color: var(--tesla-blue);
    box-shadow: 0 8px 25px rgba(25, 118, 210, 0.2);
}

.api-card:hover {
    transform: translateY(-3px);
}

.api-icon {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.api-title {
    color: var(--text-dark);
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 600;
}

.api-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.api-features {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-style: italic;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--tesla-green), #20a044);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #32c955, var(--tesla-green));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn.secondary {
    background: linear-gradient(135deg, var(--tesla-blue), #1565c0);
    box-shadow: 0 3px 12px rgba(25, 118, 210, 0.3);
}

.btn.secondary:hover {
    background: linear-gradient(135deg, #2196f3, var(--tesla-blue));
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.btn.success {
    background: linear-gradient(135deg, var(--tesla-green), #20a044);
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3);
}

.btn.fleet {
    background: linear-gradient(135deg, var(--tesla-blue), #1565c0);
    box-shadow: 0 3px 12px rgba(25, 118, 210, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* 输入框 */
.form-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--light-bg);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--tesla-green);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    background: var(--light-bg);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* 步骤指南 */
.steps {
    counter-reset: step-counter;
}

.step-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
}

.step-item::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    background: linear-gradient(135deg, var(--tesla-green), #20a044);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 14px;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

/* 警告和提示 */
.alert {
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 6px solid;
    backdrop-filter: blur(10px);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: var(--tesla-orange);
    color: var(--tesla-orange);
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--tesla-green);
    color: var(--tesla-green);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    color: #f44336;
}

.alert-info {
    background: rgba(25, 118, 210, 0.1);
    border-color: var(--tesla-blue);
    color: var(--tesla-blue);
}

/* Token显示 */
.token-display {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
    word-break: break-all;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--tesla-green);
    border: none;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.copy-btn:hover {
    background: #20a044;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

/* 返回按钮 */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(108, 117, 125, 0.8);
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(90, 98, 104, 0.9);
    transform: translateX(-2px);
}

/* 设备模式卡片 */
.device-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.device-mode {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.device-mode:hover {
    border-color: var(--tesla-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.device-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

/* 令牌信息网格 */
.token-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.info-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-card:hover {
    border-color: var(--tesla-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.info-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.info-card h4 {
    color: var(--text-dark);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin: 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card small {
    color: var(--text-muted);
    font-size: 0.8em;
    margin-top: 5px;
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .api-grid {
        flex-direction: column;
        gap: 15px;
    }
    
    .api-card {
        min-width: auto;
        max-width: none;
    }
    
    .logo {
        font-size: 2em;
    }
    
    .btn {
        display: block;
        text-align: center;
        margin: 10px 0;
        width: 100%;
    }
    
    .back-btn {
        position: static;
        display: inline-block;
        margin-bottom: 20px;
    }
    
    .device-modes {
        grid-template-columns: 1fr;
    }
    
    .token-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .info-card {
        min-height: 120px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .api-card {
        padding: 25px;
    }
    
    .card {
        padding: 20px;
    }
    
    .form-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--tesla-red);
    animation: spin 1s ease-in-out infinite;
}

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

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--tesla-green);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}