* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Main Content */
.main-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Steps Navigation */
.steps-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 0.8;
    color: var(--success-color);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.step-item.completed .step-number {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.step-title {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    max-width: 100px;
    position: relative;
    overflow: hidden;
}

.step-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: left 0.5s ease;
}

.step-item.completed + .step-connector::after {
    left: 0;
}

/* Step Content */
.step-content {
    display: none;
    padding: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.step-content.active {
    display: block;
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.next-btn, .prev-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.next-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.next-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.next-btn:disabled {
    background: var(--bg-secondary);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.prev-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.prev-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* Question Section */
.question-input {
    margin-bottom: 2rem;
}

#question {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#question:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

#question::placeholder {
    color: var(--text-light);
}

.examples {
    margin-top: 1.5rem;
}

.examples-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.example-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.example-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Method Section */
.method-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    gap: 0.25rem;
}

.method-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.method-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.method-tab:hover:not(.active) {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tab-icon {
    font-size: 1rem;
}

.method-content {
    display: none;
    min-height: 400px;
}

.method-content.active {
    display: block;
}

/* Coins Method */
.coins-container {
    text-align: center;
}

.throw-info {
    margin-bottom: 2rem;
}

.throw-counter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.current-throw {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.total-throws {
    font-size: 1rem;
    color: var(--text-secondary);
}

.throw-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.coins-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    perspective: 1000px;
}

.coin {
    width: 80px;
    height: 80px;
    position: relative;
    cursor: pointer;
}

.coin-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
}

.coin.flipping .coin-inner {
    animation: coinFlip 1s ease-in-out;
}

.coin-front,
.coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    backface-visibility: hidden;
    box-shadow: var(--shadow-lg);
}

.coin-front {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.coin-back {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    transform: rotateY(180deg);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.coin.heads .coin-inner {
    transform: rotateY(0deg);
}

.coin.tails .coin-inner {
    transform: rotateY(180deg);
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    25% { transform: rotateY(90deg) rotateX(180deg); }
    50% { transform: rotateY(180deg) rotateX(360deg); }
    75% { transform: rotateY(270deg) rotateX(540deg); }
    100% { transform: rotateY(360deg) rotateX(720deg); }
}

.throw-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.throw-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.throw-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.throw-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Manual Method */
.manual-container {
    max-width: 800px;
    margin: 0 auto;
}

.manual-hint {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.hexagram-builder {
    margin-bottom: 2rem;
}

.yao-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.yao-line:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.yao-label {
    min-width: 60px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.yao-selector {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.yao-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    min-width: 50px;
}

.yao-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.yao-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.yao-symbol {
    font-size: 1.25rem;
    font-weight: bold;
}

.yao-name {
    font-size: 0.625rem;
    font-weight: 500;
}

.yao-result {
    min-width: 80px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.manual-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Random Method */
.random-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.random-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
}

.random-button {
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.random-button.large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.random-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.reset-button {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* Result Section */
.question-review {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    text-align: center;
}

.question-review h3 {
    color: var(--primary-color);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.question-review p {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.result-display {
    margin-bottom: 2rem;
}

.hexagram-result {
    text-align: center;
    margin-bottom: 2rem;
}

.hexagram-display {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hexagram-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.hexagram-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hexagram-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.line {
    height: 6px;
    border-radius: 3px;
    position: relative;
    margin: 0 auto;
}

.line.yang {
    background: var(--primary-color);
    width: 60px;
}

.line.yin {
    background: var(--text-secondary);
    width: 60px;
    position: relative;
}

.line.yin::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 8px;
    background: var(--bg-primary);
    transform: translateX(-50%);
}

.line.changing {
    animation: pulse 1s infinite;
    box-shadow: 0 0 8px var(--primary-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-action {
    text-align: center;
    margin-bottom: 1rem;
}

#ai-analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

#ai-analysis-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.ai-result {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.ai-result h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.ai-content {
    line-height: 1.7;
    opacity: 0.95;
}

/* Info Section */
.info-section {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .header {
        margin-bottom: 2rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* 步骤导航移动端优化 */
    .steps-nav {
        padding: 1rem;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .step-item {
        flex-shrink: 0;
        min-width: 80px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .step-title {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .step-connector {
        height: 2px;
        min-width: 30px;
        max-width: 50px;
        margin: 16px 0;
    }
    
    /* 步骤内容区域 */
    .step-content {
        padding: 1rem;
    }
    
    .step-header {
        margin-bottom: 1.5rem;
    }
    
    .step-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .step-description {
        font-size: 0.875rem;
    }
    
    /* 问题输入优化 */
    #question {
        min-height: 100px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .examples-title {
        font-size: 0.8rem;
    }
    
    .example-tags {
        gap: 0.375rem;
    }
    
    .example-tag {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        touch-action: manipulation; /* 提升触摸响应 */
    }
    
    /* 起卦方式选择优化 */
    .method-tabs {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .method-tab {
        padding: 1rem;
        font-size: 0.875rem;
        touch-action: manipulation;
    }
    
    .tab-icon {
        font-size: 1.25rem;
    }
    
    /* 硬币投掷优化 */
    .coins-container {
        padding: 0.5rem;
    }
    
    .throw-counter {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .current-throw {
        font-size: 1.125rem;
    }
    
    .throw-hint {
        font-size: 0.8rem;
        padding: 0 1rem;
        text-align: center;
    }
    
    .coins-display {
        gap: 1rem;
        margin: 1.5rem 0;
        justify-content: space-around;
    }
    
    .coin {
        width: 70px;
        height: 70px;
        touch-action: manipulation;
    }
    
    .coin-front,
    .coin-back {
        font-size: 0.875rem;
    }
    
    .throw-actions {
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .throw-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px; /* 符合触摸标准 */
        touch-action: manipulation;
    }
    
    /* 手动选择优化 */
    .manual-container {
        padding: 0.5rem;
    }
    
    .manual-hint {
        padding: 0.875rem;
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .hexagram-builder {
        margin-bottom: 1.5rem;
    }
    
    .yao-line {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .yao-label {
        min-width: auto;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .yao-selector {
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .yao-btn {
        min-width: 64px;
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        touch-action: manipulation;
        min-height: 48px; /* 触摸友好 */
    }
    
    .yao-symbol {
        font-size: 1.5rem;
    }
    
    .yao-result {
        min-width: auto;
        font-size: 1.75rem;
        margin-top: 0.5rem;
    }
    
    .manual-actions {
        gap: 0.75rem;
    }
    
    /* 随机起卦优化 */
    .random-container {
        padding: 0.5rem;
    }
    
    .random-info {
        padding: 1rem;
        margin-bottom: 1.5rem;
        font-size: 0.875rem;
    }
    
    .random-button.large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    /* 按钮优化 */
    .step-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .next-btn, .prev-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        touch-action: manipulation;
        width: 100%;
        justify-content: center;
    }
    
    .reset-button, .random-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        min-height: 44px;
        touch-action: manipulation;
        flex: 1;
    }
    
    /* 结果显示优化 */
    .question-review {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .question-review h3 {
        font-size: 1rem;
    }
    
    .question-review p {
        font-size: 0.9rem;
    }
    
    .hexagram-display {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .hexagram-item {
        padding: 1rem;
    }
    
    .hexagram-name {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .hexagram-lines {
        margin-bottom: 0.75rem;
    }
    
    .line {
        width: 50px;
        height: 5px;
    }
    
    .line.yin::before {
        width: 6px;
    }
    
    #ai-analysis-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        touch-action: manipulation;
        width: 100%;
        justify-content: center;
    }
    
    .ai-result {
        padding: 1rem;
    }
    
    .ai-result h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .ai-content {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    /* 信息区域优化 */
    .info-section {
        padding: 1.5rem 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .info-icon {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .info-card h3 {
        font-size: 0.9rem;
    }
    
    .info-card p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem 0.25rem;
    }
    
    .header {
        margin-bottom: 1.5rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    /* 更小屏幕的步骤导航 */
    .steps-nav {
        padding: 0.75rem 0.5rem;
        gap: 0.25rem;
    }
    
    .step-item {
        min-width: 70px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .step-title {
        font-size: 0.7rem;
    }
    
    .step-connector {
        min-width: 20px;
        max-width: 30px;
        margin: 14px 0;
    }
    
    /* 内容区域 */
    .step-content {
        padding: 0.75rem;
    }
    
    .step-header h2 {
        font-size: 1.375rem;
    }
    
    .step-description {
        font-size: 0.8rem;
    }
    
    /* 问题输入 */
    #question {
        min-height: 90px;
        padding: 0.875rem;
    }
    
    .example-tag {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
    
    /* 硬币 */
    .coins-display {
        gap: 0.75rem;
        margin: 1rem 0;
    }
    
    .coin {
        width: 60px;
        height: 60px;
    }
    
    .coin-front,
    .coin-back {
        font-size: 0.8rem;
    }
    
    .throw-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* 手动选择 */
    .yao-line {
        padding: 0.75rem 0.5rem;
    }
    
    .yao-btn {
        min-width: 56px;
        padding: 0.625rem 0.375rem;
        font-size: 0.75rem;
        min-height: 44px;
    }
    
    .yao-symbol {
        font-size: 1.25rem;
    }
    
    .yao-result {
        font-size: 1.5rem;
    }
    
    /* 按钮 */
    .next-btn, .prev-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .reset-button, .random-button {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    /* 结果显示 */
    .hexagram-item {
        padding: 0.875rem;
    }
    
    .hexagram-name {
        font-size: 1.125rem;
    }
    
    .line {
        width: 45px;
        height: 4px;
    }
    
    .line.yin::before {
        width: 5px;
    }
    
    #ai-analysis-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .ai-result {
        padding: 0.875rem;
    }
    
    .ai-content {
        font-size: 0.8rem;
    }
    
    /* 信息卡片 */
    .info-card {
        padding: 0.875rem;
    }
    
    .info-icon {
        font-size: 1.375rem;
    }
    
    .info-card h3 {
        font-size: 0.85rem;
    }
    
    .info-card p {
        font-size: 0.75rem;
    }
}

/* 触摸设备专用优化 */
@media (pointer: coarse) {
    /* 增大可点击区域 */
    .example-tag,
    .method-tab,
    .yao-btn,
    .throw-button,
    .next-btn,
    .prev-btn,
    .reset-button,
    .random-button,
    #ai-analysis-btn {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    /* 提升触摸响应 */
    .coin {
        transform: scale(1);
        transition: transform 0.1s ease;
    }
    
    .coin:active {
        transform: scale(0.95);
    }
    
    /* 防止双击缩放 */
    .step-content {
        touch-action: pan-y;
    }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        margin-bottom: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    .steps-nav {
        padding: 0.75rem;
    }
    
    .step-content {
        padding: 1rem;
    }
    
    .coins-display {
        margin: 1rem 0;
    }
    
    .hexagram-builder {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .yao-line {
        margin-bottom: 0.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --bg-tertiary: #4b5563;
        --border-color: #4b5563;
    }
} 