/* ============================================
   肺段坐标精细定位 - 全局样式
   复刻自demo小程序 app.wxss
   ============================================ */

/* ─── Reset ───────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f6f7f7;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px;
}


/* ============================================
   介绍页 - 复刻 demo pages/3d/index
   ============================================ */

.intro-page {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Hero区域 */
.hero-section {
    width: 100%;
    position: relative;
}

.doctor-bg {
    width: 100%;
    display: block;
}

/* 标题 - 复刻 .doc-title */
.doc-title {
    text-align: center;
    font-size: 20px;
    line-height: 34px;
    color: #000;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 0 20px;
}

/* 描述 - 复刻 .doc-desc */
.doc-desc {
    padding: 0 20px;
    font-size: 14px;
    color: #333;
    line-height: 22px;
    margin-bottom: 15px;
}

.doc-desc-gray {
    color: #666;
}

/* 资讯配图区域 - 复刻 .secarr */
.secarr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.news-photo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 0 20px;
    width: calc(100% - 40px);
}

/* 肺部健康知识标题 - 复刻 .news-title */
.news-title {
    text-align: right;
    background: linear-gradient(90deg, #76C8C9, #E1FCFF);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    line-height: 40px;
    color: #333;
    margin: 24px 0 10px;
    padding-right: 20px;
}

/* 知识卡片 - 复刻 .news-box */
.news-card {
    margin: 8px 12px;
    border-radius: 8px;
    border: 1px solid #F6F7F7;
    box-shadow: 1px 2px 5px 0px rgba(85,121,121,0.08);
    padding: 12px 10px 8px;
    position: relative;
    cursor: pointer;
    background: #fff;
}

/* 科普标签 - 复刻 .news-icon */
.news-icon {
    position: absolute;
    top: 0;
    left: 0;
    background: #20D49F;
    border-radius: 2px;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    padding: 0 8px;
    flex-shrink: 0;
}

/* 新闻文本区 */
.news-text-wrap {
    flex: 1;
    padding-left: 55px;
    min-width: 0;
}

.news-box-title {
    font-size: 15px;
    line-height: 22px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-box-desc {
    font-size: 12px;
    line-height: 18px;
    color: #999;
    margin-top: 2px;
}

/* 新闻图片区 */
.news-img-wrap {
    width: 98px;
    height: 102px;
    flex-shrink: 0;
}

.news-box-img-placeholder {
    width: 98px;
    height: 102px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 底部提交按钮 - 复刻 .indexBtn */
.intro-submit-wrap {
    padding: 26px 20px 10px;
}

.indexBtn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, #80D4D5 0%, #A9F0F7 85%);
    box-shadow: 0px 2px 9px 0px rgba(120,120,120,0.18);
    font-size: 18px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    -webkit-appearance: none;
}

.indexBtn:active {
    opacity: 0.9;
    transform: scale(0.98);
}

/* 底部信息 - 复刻 .foot */
.foot {
    text-align: center;
    font-size: 12px;
    color: #bababa;
    padding: 20px 0 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}


/* ============================================
   下单页 - 复刻 order.html
   ============================================ */

.header {
    text-align: center;
    padding: 20px 0 16px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.header .subtitle {
    font-size: 14px;
    color: #999;
}

/* Card */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid #F6F7F7;
    box-shadow: 0px 2px 6px 0px rgba(85,121,121,0.08);
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f6f7f7;
}

/* Service Card */
.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #666;
}

.service-row:not(:last-child) {
    border-bottom: 1px solid #f6f7f7;
    margin-bottom: 6px;
    padding-bottom: 6px;
}

.service-type {
    background: #f0f7f7;
    color: #009B9C;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: #FF6633;
}

.price::before {
    content: '¥';
    font-size: 13px;
}

/* Form */
.form-group {
    margin-bottom: 14px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: #FF6633;
}

.form-label.optional::after {
    content: '（选填）';
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

.form-input,
.form-select {
    width: 100%;
    height: 42px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: #333;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
    border-color: #7AC9CA;
    box-shadow: 0 0 0 2px rgba(122,201,202,0.15);
    background: #fff;
}

.form-input.error {
    border-color: #FF6633;
    box-shadow: 0 0 0 2px rgba(255,102,51,0.1);
}

.form-input::placeholder {
    color: #ccc;
}

.form-select {
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 32px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 10px;
}

.radio-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.2s;
}

.radio-item.selected {
    border-color: #7AC9CA;
    color: #009B9C;
    background: #f0f8f8;
}

.radio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.radio-item.selected .radio-dot {
    border-color: #009B9C;
}

.radio-item.selected .radio-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #009B9C;
}

/* 知情同意 - 复刻 demo pages/3d/add 协议部分 */
.agree-card {
    padding: 12px 16px;
}

.agree-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.agree-check-wrap {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #c8c8c8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 0;
    transition: all 0.2s;
}

.agree-check-wrap.checked {
    background: #009B9C;
    border-color: #009B9C;
}

.agree-check-icon {
    width: 10px;
    height: 6px;
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(-45deg);
    transition: all 0.15s;
}

.agree-check-wrap.checked .agree-check-icon {
    border-color: #fff;
}

.agree-text {
    font-size: 13px;
    color: #666;
    line-height: 22px;
}

.agree-link {
    color: #7AC9CA;
    cursor: pointer;
}

/* Submit */
.submit-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 16px 20px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid #f0f0f0;
}

.btn-submit {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: linear-gradient(180deg, #80D4D5 0%, #A9F0F7 85%);
    box-shadow: 0px 2px 9px 0px rgba(120,120,120,0.18);
    cursor: pointer;
    transition: opacity 0.2s;
    -webkit-appearance: none;
}

.btn-submit:active {
    opacity: 0.85;
}

.btn-submit:disabled {
    background: #e0e0e0;
    color: #bbb;
    box-shadow: none;
    cursor: not-allowed;
}


/* ============================================
   协议弹窗 - 复刻 demo pages/tem/protocal
   ============================================ */

.protocal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.protocal-mask.show {
    opacity: 1;
    pointer-events: all;
}

.protocal-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px 12px 0 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.protocal-popup.show {
    transform: translateY(0);
}

.protocal-header {
    flex-shrink: 0;
    padding: 16px 16px 0;
}

.protocal-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.protocal-tab {
    flex: 1;
    text-align: center;
    font-size: 15px;
    line-height: 40px;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.protocal-tab.active {
    color: #009B9C;
    border-bottom-color: #009B9C;
    font-weight: 500;
}

.protocal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-size: 14px;
    line-height: 24px;
    color: #333;
    -webkit-overflow-scrolling: touch;
}

.protocal-body h3 {
    font-size: 16px;
    margin: 16px 0 8px;
    color: #000;
}

.protocal-body h3:first-child {
    margin-top: 0;
}

.protocal-body p {
    margin-bottom: 8px;
    text-indent: 2em;
}

.protocal-body ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

.protocal-body li {
    margin-bottom: 4px;
}

.protocal-footer {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

.protocal-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.protocal-btn:active {
    opacity: 0.85;
}

.protocal-btn.disagree {
    background: #f5f5f5;
    color: #666;
}

.protocal-btn.agree {
    background: linear-gradient(90deg, #80D4D5, #A9F0F7);
    color: #333;
}


/* ============================================
   结果页
   ============================================ */

.result-header {
    text-align: center;
    padding: 32px 0 20px;
}

.result-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 12px;
}

.result-icon.success {
    background: #ecfdf5;
    color: #16a34a;
}

.result-icon.primary {
    background: #f0f8f8;
    color: #009B9C;
}

.result-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.result-header p {
    font-size: 14px;
    color: #999;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid #f5f5f5;
}

.info-key {
    color: #999;
    flex-shrink: 0;
    margin-right: 12px;
}

.info-value {
    color: #333;
    text-align: right;
    word-break: break-all;
}

.price-red {
    color: #FF6633;
    font-weight: 700;
    font-size: 16px;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-UNPAID { background: #FFF7ED; color: #EA580C; }
.status-PAID { background: #ecfdf5; color: #16a34a; }
.status-CANCELLED { background: #f5f5f5; color: #999; }

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0 40px;
}

.btn-pay,
.btn-cancel,
.btn-back {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    -webkit-appearance: none;
}

.btn-pay {
    color: #333;
    background: linear-gradient(180deg, #80D4D5 0%, #A9F0F7 85%);
    box-shadow: 0px 2px 9px 0px rgba(120,120,120,0.18);
}

.btn-cancel {
    color: #666;
    background: #fff;
    border: 1px solid #eee;
}

.btn-back {
    color: #666;
    background: #f5f5f5;
}

.btn-pay:active,
.btn-cancel:active,
.btn-back:active {
    opacity: 0.85;
}


/* ============================================
   通用组件
   ============================================ */

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #7AC9CA;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-overlay p {
    margin-top: 12px;
    font-size: 14px;
    color: #999;
}

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

/* ─── 支付弹窗 ──────────────────────────── */
.pay-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.pay-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    width: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.pay-modal h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}
.pay-modal-price {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 16px;
}
.pay-modal img {
    display: block;
    margin: 0 auto 12px;
    border: 1px solid #eee;
    border-radius: 4px;
}
.pay-modal-tip {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}
.pay-modal .btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #009B9C;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}
.pay-modal .btn-cancel {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #999;
    font-size: 14px;
    cursor: pointer;
}
.pay-modal-poll {
    font-size: 12px;
    color: #009B9C;
    margin-bottom: 8px;
    min-height: 18px;
}

@media (max-width: 360px) {
    .container { padding: 12px; padding-bottom: 100px; }
    .card { padding: 14px; }
    .header h1 { font-size: 18px; }
}
