/* 中医主题配色 */
:root {
    --primary-color: #8f3c2d; /* 中医红/棕色 */
    --secondary-color: #2d5c2a; /* 中医绿 */
    --accent-color: #e6a23c; /* 中医黄/琥珀色 */
    --light-bg: #f8f3e9; /* 浅米色背景 */
    --dark-text: #333333;
    --light-text: #666666;
    --border-color: #d4b78f;
    --success-color: #2d5c2a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: Arial;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.5;
    font-size: 16px;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.app-container {
    max-width: 100%;
    min-height: 100vh;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* 进度指示器 */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    padding: 0 10px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    position: relative;
    width: 25%;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e0d6c8;
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    border: 2px solid #e0d6c8;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.progress-step.completed .step-circle {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-text {
    font-size: 13px;
    color: var(--light-text);
    text-align: center;
    font-weight: 500;
}

.progress-step.active .step-text {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-line {
    position: absolute;
    top: 18px;
    left: 20%;
    width: 60%;
    height: 3px;
    background-color: #e0d6c8;
    z-index: 1;
}

.progress-fill {
    position: absolute;
    top: 18px;
    left: 19%;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 1;
    transition: width 0.3s ease;
}

/* 页面容器 */
.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
    flex-direction: column;
    flex: 1;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 25px 20px;
    overflow: hidden;
}

.page.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.page-header h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.page-header p {
    font-size: 15px;
    color: var(--light-text);
}

.page-header-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(143, 60, 45, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.page-header-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
}

/* 内容区域 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fcf9f3;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    max-height: 55vh;
}

.content-area h2 {
    color: var(--secondary-color);
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.content-area h3 {
    color: var(--primary-color);
    font-size: 17px;
    margin: 18px 0 10px 0;
}

.content-area p {
    margin-bottom: 15px;
    text-align: justify;
    font-size: 16px;
    line-height: 1.6;
}

.content-area ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-area li {
    margin-bottom: 10px;
    padding-left: 5px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.form-label span {
    color: #ff4d4f;
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

textarea.form-control {
    min-height: 120px;
    resize: none;
    line-height: 1.5;
    font-family: Arial;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238f3c2d'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
}

/* 签名区域 */
.signature-container {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-top: 5px;
    background-color: #fcf9f3;
    min-height: 180px;
    position: relative;
}

#signatureCanvas {
    border: 1px solid #ddd;
    background-color: white;
    cursor: crosshair;
    border-radius: 8px;
    width: 100%;
    height: 160px;
    touch-action: none;
}

.signature-preview {
    display: none;
    margin-top: 15px;
    text-align: center;
}

.signature-preview h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 16px;
}

.signature-preview img {
    max-width: 200px;
    max-height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
}

.signature-controls {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.signature-btn {
    padding: 10px 20px;
    background-color: #e0d6c8;
    color: var(--dark-text);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    margin: 0 5px;
}

.signature-btn:hover {
    background-color: #d4c5b0;
}

.signature-btn.clear-btn {
    background-color: rgba(143, 60, 45, 0.1);
    color: var(--primary-color);
}

.signature-btn.clear-btn:hover {
    background-color: rgba(143, 60, 45, 0.2);
}

/* 按钮区域 */
.button-container {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    flex: 1;
    padding: 18px 15px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: #7a3428;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(143, 60, 45, 0.2);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--dark-text);
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn:disabled {
    background-color: #e0d6c8;
    color: #a89e8e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 计时器 */
.timer-display {
    text-align: center;
    margin-top: 15px;
    color: var(--light-text);
    font-size: 14px;
    min-height: 20px;
}

.scroll-hint {
    text-align: center;
    color: var(--accent-color);
    font-size: 14px;
    margin-top: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.scroll-hint svg {
    width: 18px;
    height: 18px;
    fill: var(--accent-color);
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 阅读进度条 */
.reading-progress {
    width: 100%;
    height: 4px;
    background-color: #e0d6c8;
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.reading-progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* 成功页面 */
.success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    flex: 1;
}

.success-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: rgba(45, 92, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.success-icon svg {
    width: 50px;
    height: 50px;
    fill: var(--success-color);
}

.success-title {
    font-size: 28px;
    color: var(--success-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.success-message {
    font-size: 18px;
    color: var(--light-text);
    margin-bottom: 25px;
    line-height: 1.6;
}

.submitted-info {
    width: 100%;
    margin: 20px 0;
    padding: 20px;
    background-color: #fcf9f3;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.submitted-info h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.submitted-info-item {
    margin-bottom: 12px;
    display: flex;
}

.submitted-info-label {
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 100px;
}

.submitted-info-value {
    flex: 1;
    color: var(--dark-text);
}

.signature-preview-small {
    max-width: 150px;
    max-height: 60px;
    margin-top: 5px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
}

.herbal-decoration {
    width: 100%;
    max-width: 200px;
    margin: 30px auto;
    opacity: 0.7;
}

.herbal-decoration svg {
    width: 100%;
    height: auto;
}

.thank-you-note {
    font-size: 16px;
    color: var(--primary-color);
    font-style: italic;
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(143, 60, 45, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

/* 中医装饰元素 */
.yin-yang {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0.1;
    z-index: 0;
}

.yin-yang.top-left {
    top: 15px;
    left: 15px;
}

.yin-yang.bottom-right {
    bottom: 15px;
    right: 15px;
}

/* 页面特定样式 */
.page-1 .page-header-icon {
    background-color: rgba(143, 60, 45, 0.1);
}

.page-2 .page-header-icon {
    background-color: rgba(45, 92, 42, 0.1);
}

.page-3 .page-header-icon {
    background-color: rgba(230, 162, 60, 0.1);
}

/* 响应式调整 */
@media (max-width: 360px) {
    .app-container {
        padding: 10px;
    }
    
    .page {
        padding: 20px 15px;
    }
    
    .btn {
        padding: 16px 12px;
        font-size: 16px;
    }
    
    .content-area {
        padding: 15px;
        max-height: 50vh;
    }
}

@media (max-width: 320px) {
    .signature-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .signature-btn {
        margin: 0;
    }
}