/* Index Page - 德系CDS风格 (从 index.html 迁移) */

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

:root {
    --primary-blue: #1a365d;
    --primary-blue-dark: #0f2744;
    --left-section-blue: #2d4a6a;
    --button-blue: #3d5a75;
    --white: #ffffff;
    --text-gray: #4a5568;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--primary-blue);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 主功能标题栏 */
.main-title-bar {
    background: var(--primary-blue);
    padding: 14px 20px;
    text-align: center;
}

.main-title-bar h2 {
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
    letter-spacing: 0.5px;
}

/* 轮播图区域 */
.carousel-section {
    position: relative;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--primary-blue);
}

.carousel-track {
    display: flex;
    width: 100%;
    align-items: flex-start;
    transition: transform 0.4s ease;
    flex-wrap: nowrap;
}

/* CSP 兼容：用 data 属性替代 style.transform */
.carousel-track[data-slide-index="0"] { transform: translateX(0); }
.carousel-track[data-slide-index="1"] { transform: translateX(-100%); }
.carousel-track[data-slide-index="2"] { transform: translateX(-200%); }
.carousel-track[data-slide-index="3"] { transform: translateX(-300%); }
.carousel-track[data-slide-index="4"] { transform: translateX(-400%); }
.carousel-track[data-slide-index="5"] { transform: translateX(-500%); }
.carousel-track[data-slide-index="6"] { transform: translateX(-600%); }
.carousel-track[data-slide-index="7"] { transform: translateX(-700%); }
.carousel-track[data-slide-index="8"] { transform: translateX(-800%); }
.carousel-track[data-slide-index="9"] { transform: translateX(-900%); }

.d-none { display: none !important; }
.img-hidden { display: none !important; }

.carousel-item {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    line-height: 0;
}

.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: bottom;
}

.carousel-overlay {
    position: absolute;
    bottom: 20px;
    right: 16px;
    text-align: right;
}

.carousel-overlay .cds-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.carousel-overlay .cds-slogan {
    font-size: 11px;
    color: var(--white);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    margin-top: 4px;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: #48bb78;
}

/* 功能操作区 */
.action-section {
    display: flex;
    min-height: 200px;
    position: relative;
}

/* 查询结果弹窗 */
.query-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

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

.query-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.query-modal-content {
    position: relative;
    z-index: 1;
    width: calc(100% - 40px);
    max-width: 320px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    padding: 20px;
    color: #1a1a1a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #1a1a1a;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding-right: 30px;
    text-align: center;
}

.modal-body {
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.8;
    text-align: center;
}

.modal-body p {
    margin: 8px 0;
}

.modal-result-text {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.action-grid {
    display: flex;
    width: 100%;
}

/* 左侧查询块 */
.query-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--left-section-blue);
}

.action-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* 右侧导航块 */
.nav-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 24px 16px;
    background: var(--primary-blue);
}

.query-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.query-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.query-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: var(--white);
    color: #1a1a1a;
    font-size: 14px;
}

.query-input::placeholder {
    color: #a0aec0;
}

.query-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--button-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.query-btn:active {
    background: #234e77;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.nav-label {
    font-size: 13px;
    color: var(--white);
}

.nav-phone {
    font-size: 12px;
    color: var(--white);
    font-weight: 500;
}

/* 底部版权 */
.app-footer {
    background: var(--white);
    padding: 12px 20px;
    text-align: center;
}

.app-footer p {
    font-size: 12px;
    color: var(--text-gray);
}

/* 扫码按钮（微信环境） */
.query-block .scan-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.scan-icon {
    width: 28px;
    height: 28px;
    position: relative;
    background: transparent;
}

.scan-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: #999;
    border-style: solid;
    border-width: 0;
}

.corner-tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.corner-tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.corner-bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.corner-br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.middle-line {
    position: absolute;
    top: 0;
    left: 4px;
    right: 4px;
    height: 1px;
    background: #999;
    animation: scanAnimation 2s infinite linear;
}

@keyframes scanAnimation {
    0% { top: 0; opacity: 1; }
    50% { top: 100%; opacity: 0.7; }
    100% { top: 0; opacity: 1; }
}

.input-with-scan {
    position: relative;
    width: 100%;
}

.input-with-scan .query-input {
    padding-right: 48px;
}
