/* ZEEHO 助手 - 美化版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #1e40af 100%);
    background-attachment: fixed;
    color: #e2e8f0;
    line-height: 1.5;
    padding-bottom: 30px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰光晕 */
body::before {
    content: '';
    position: fixed;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

/* 头部 */
.header {
    padding: 8px 4px 20px;
    text-align: center;
}

.header h1 {
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
}

.header .subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* 卡片 - 毛玻璃 */
.card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f1f5f9;
}

.card-title .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* 表单元素 */
label {
    display: block;
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: rgba(96, 165, 250, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
}

textarea {
    resize: vertical;
    min-height: 48px;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* 按钮 */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: #93c5fd;
    border: 1.5px solid rgba(96, 165, 250, 0.3);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(96, 165, 250, 0.5);
}

.btn-danger-text {
    background: rgba(255, 255, 255, 0.05);
    color: #fca5a5;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-text:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

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

/* 当前车辆 */
.vehicle-info {
    margin-top: 14px;
    font-size: 14px;
    color: #94a3b8;
}

.vehicle-info strong {
    color: #e2e8f0;
}

/* 开关行 */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.switch-row .label {
    font-size: 15px;
    color: #e2e8f0;
    flex: 1;
    line-height: 1.4;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

/* 状态行 */
.status-line {
    margin-top: 16px;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.8;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-line .configured {
    color: #4ade80;
    font-weight: 600;
}

.status-line .unconfigured {
    color: #f87171;
    font-weight: 600;
}

.hint-text {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* 日志区 - 终端风格 */
.log-box {
    width: 100%;
    min-height: 220px;
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
    font-family: "SF Mono", "Consolas", "Monaco", "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.8;
    color: #cbd5e1;
    white-space: pre-wrap;
    word-break: break-all;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.3) transparent;
}

.log-box::-webkit-scrollbar {
    width: 6px;
}

.log-box::-webkit-scrollbar-track {
    background: transparent;
}

.log-box::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 3px;
}

.log-placeholder {
    color: #475569;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* 日志行 - 逐行动画 */
.log-line {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.log-line.show {
    opacity: 1;
    transform: translateY(0);
}

/* 日志行颜色区分 */
.log-line:has(✅) {
    color: #4ade80;
}

.log-line:has(❌) {
    color: #f87171;
}

.log-line:has(⚠️) {
    color: #fbbf24;
}

.log-line:has(📊),
.log-line:has(🚗),
.log-line:has(📡),
.log-line:has(✍️),
.log-line:has(🎁),
.log-line:has(⏳) {
    color: #93c5fd;
}

.log-line:has(────) {
    color: #a78bfa;
    font-weight: 600;
    text-align: center;
    border-bottom: none;
    padding: 6px 0;
}

/* 底部声明 */
.footer {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    padding: 16px 20px 0;
    line-height: 1.6;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: #f1f5f9;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 80%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
}

/* 车辆选择弹窗 */
.modal-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal-mask.show {
    display: flex;
}

.modal {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 24px 20px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
    color: #f1f5f9;
}

.vehicle-item {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
}

.vehicle-item:hover,
.vehicle-item.selected {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(59, 130, 246, 0.1);
}

.vehicle-item .v-name {
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
}

.vehicle-item .v-vin {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.modal-close {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 15px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* loading */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* 重要提醒弹窗 */
.notice-modal {
    text-align: center;
    border-radius: 20px;
    padding: 32px 24px 24px;
    animation: noticePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes noticePop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.notice-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: noticePulse 2s ease-in-out infinite;
}

@keyframes noticePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notice-title {
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.notice-content {
    font-size: 15px;
    color: #e2e8f0;
    line-height: 1.8;
    margin-bottom: 8px;
}

.notice-content p {
    margin-bottom: 8px;
}

.notice-content strong {
    color: #f87171;
    font-weight: 700;
}

.notice-link a {
    color: #60a5fa;
    text-decoration: underline;
    word-break: break-all;
    font-size: 13px;
}

.notice-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    text-decoration: none;
    text-align: center;
}

.notice-close {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.notice-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}
