/* iOS风格样式 - 算命网站 */
:root {
    --ios-bg: #f2f2f7;
    --ios-card-bg: #ffffff;
    --ios-primary: #007aff;
    --ios-secondary: #5856d6;
    --ios-success: #34c759;
    --ios-warning: #ff9500;
    --ios-danger: #ff3b30;
    --ios-text: #000000;
    --ios-text-secondary: #8e8e93;
    --ios-border: #c7c7cc;
    --ios-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --ios-radius: 14px;
    --ios-radius-small: 10px;
    --ios-spacing: 16px;
    --ios-spacing-small: 12px;
    --ios-spacing-large: 20px;
}

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

body {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--ios-bg);
    color: var(--ios-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(180deg, #f2f2f7 0%, #e5e5ea 100%);
}

.ios-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 83px; /* Tab栏高度 */
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--ios-spacing);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.status-bar .time {
    font-weight: 600;
    font-size: 15px;
}

.status-icons {
    display: flex;
    gap: 5px;
    color: var(--ios-text);
}

.status-icons i {
    font-size: 14px;
}

/* 导航栏 */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--ios-spacing);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-text);
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.ios-btn {
    background: var(--ios-primary);
    color: white;
    border: none;
    border-radius: var(--ios-radius-small);
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ios-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ios-btn:active {
    transform: translateY(0);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-primary);
}

/* 主要内容 */
.main-content {
    flex: 1;
    padding: var(--ios-spacing);
    padding-bottom: 0;
}

/* iOS卡片 */
.ios-card {
    background: var(--ios-card-bg);
    border-radius: var(--ios-radius);
    padding: var(--ios-spacing);
    margin-bottom: var(--ios-spacing);
    box-shadow: var(--ios-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ios-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--ios-spacing);
    padding-bottom: var(--ios-spacing-small);
    border-bottom: 1px solid var(--ios-border);
}

.card-header h3 {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-content {
    color: var(--ios-text);
}

/* 个人信息卡片 */
.profile-card .card-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: var(--ios-spacing);
}

.avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--ios-spacing);
}

.avatar i {
    font-size: 40px;
    color: white;
}

.profile-info h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--ios-text);
}

.subtitle {
    color: var(--ios-text-secondary);
    font-size: 15px;
    margin-bottom: 4px;
}

.location {
    color: var(--ios-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 八字网格 */
.bazi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ios-spacing-small);
}

.bazi-item {
    display: flex;
    flex-direction: column;
}

.bazi-label {
    font-size: 13px;
    color: var(--ios-text-secondary);
    margin-bottom: 4px;
}

.bazi-value {
    font-size: 16px;
    font-weight: 500;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--ios-radius-small);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.highlight {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    color: white;
    font-weight: 600;
}

.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--ios-success);
    border-color: rgba(52, 199, 89, 0.2);
}

.warning {
    background: rgba(255, 149, 0, 0.1);
    color: var(--ios-warning);
    border-color: rgba(255, 149, 0, 0.2);
}

/* 五行图表 */
.wuxing-chart {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.wuxing-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.wuxing-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text);
}

.wuxing-bar {
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.3));
    border-radius: var(--ios-radius-small);
    position: relative;
    overflow: hidden;
}

.wuxing-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--value) * 33%);
    background: linear-gradient(to top, #007aff, #5856d6);
    border-radius: var(--ios-radius-small);
}

.wuxing-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--ios-primary);
}

/* 时间线 */
.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--ios-spacing);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: var(--ios-spacing);
    padding: var(--ios-spacing-small);
    border-radius: var(--ios-radius-small);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.timeline-item:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.2);
}

.timeline-item.current {
    background: rgba(0, 122, 255, 0.08);
    border-color: rgba(0, 122, 255, 0.3);
}

.timeline-item.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(88, 86, 214, 0.15));
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
}

.timeline-year {
    min-width: 70px;
    font-weight: 600;
    font-size: 15px;
    color: var(--ios-primary);
}

.timeline-content {
    flex: 1;
    font-size: 15px;
    color: var(--ios-text);
}

.timeline-content strong {
    color: var(--ios-text);
}

/* 性格网格 */
.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ios-spacing);
}

.character-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--ios-spacing);
    border-radius: var(--ios-radius);
    transition: all 0.2s ease;
}

.character-item.positive {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.character-item.negative {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.2);
}

.character-item i {
    font-size: 24px;
    margin-bottom: 8px;
}

.character-item.positive i {
    color: var(--ios-success);
}

.character-item.negative i {
    color: var(--ios-warning);
}

.character-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.character-item p {
    font-size: 13px;
    color: var(--ios-text-secondary);
}

/* 建议列表 */
.advice-list {
    display: flex;
    flex-direction: column;
    gap: var(--ios-spacing);
}

.advice-item {
    display: flex;
    align-items: flex-start;
    gap: var(--ios-spacing);
    padding: var(--ios-spacing-small);
    border-radius: var(--ios-radius-small);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.advice-item:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.2);
    transform: translateX(4px);
}

.advice-item i {
    font-size: 20px;
    color: var(--ios-primary);
    margin-top: 2px;
}

.advice-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ios-text);
}

.advice-item p {
    font-size: 14px;
    color: var(--ios-text-secondary);
    line-height: 1.4;
}

/* 年份列表 */
.year-list {
    display: flex;
    flex-direction: column;
    gap: var(--ios-spacing-small);
}

.year-item {
    display: flex;
    align-items: center;
    gap: var(--ios-spacing);
    padding: var(--ios-spacing-small);
    border-radius: var(--ios-radius-small);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.year-item:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.2);
}

.year-item.important {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(88, 86, 214, 0.1));
    border-color: rgba(0, 122, 255, 0.3);
}

.year {
    min-width: 60px;
    font-weight: 700;
    font-size: 18px;
    color: var(--ios-primary);
    text-align: center;
}

.year-content {
    flex: 1;
}

.year-content strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ios-text);
}

.year-content p {
    font-size: 14px;
    color: var(--ios-text-secondary);
}

/* Tab栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    max-width: 500px;
    margin: 0 auto;
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--ios-text-secondary);
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: var(--ios-radius);
}

.tab-item:hover {
    background: rgba(0, 122, 255, 0.05);
}

.tab-item.active {
    color: var(--ios-primary);
}

.tab-item i {
    font-size: 20px;
}

.tab-item span {
    font-size: 11px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 500px) {
    body {
        border-radius: 0;
    }
    
    .ios-container {
        padding-bottom: 83px;
    }
    
    .character-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 375px) {
    .bazi-grid {
        grid-template-columns: 1fr;
    }
    
    .wuxing-chart {
        flex-direction: column;
        gap: var(--ios-spacing);
    }
    
    .wuxing-item {
        flex-direction: row;
        align-items: center;
    }
    
    .wuxing-bar {
        width: 60px;
        height: 60px;
    }
}
/* 页面切换样式 */
.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 运势页面样式 */
.fortune-today {
    text-align: center;
    padding: var(--ios-spacing);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007aff, #5856d6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

.score-value {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 14px;
    opacity: 0.9;
}

.fortune-desc {
    font-size: 16px;
    color: var(--ios-text-secondary);
}

.fortune-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fortune-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    min-width: 50px;
    font-size: 14px;
    color: var(--ios-text);
}

.bar-track {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007aff, #5856d6);
    border-radius: 4px;
    width: var(--width);
    transition: width 0.5s ease;
}

.bar-value {
    min-width: 40px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-primary);
    text-align: right;
}

.suggestion-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggestion-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.suggestion-list i.fa-check-circle {
    color: var(--ios-success);
}

.suggestion-list i.fa-times-circle {
    color: var(--ios-danger);
}

.suggestion-list i.fa-palette {
    color: var(--ios-primary);
}

.suggestion-list i.fa-compass {
    color: var(--ios-secondary);
}

.time-fortune {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border-radius: var(--ios-radius-small);
    font-size: 13px;
}

.time-item.good {
    background: rgba(52, 199, 89, 0.1);
}

.time-item.normal {
    background: rgba(142, 142, 147, 0.1);
}

.time-item.bad {
    background: rgba(255, 59, 48, 0.1);
}

.time-item i {
    font-size: 18px;
}

.time-item.good i {
    color: var(--ios-success);
}

.time-item.normal i {
    color: var(--ios-text-secondary);
}

.time-item.bad i {
    color: var(--ios-danger);
}

/* 解读页面样式 */
.interpretation-section {
    margin-bottom: var(--ios-spacing);
}

.interpretation-section:last-child {
    margin-bottom: 0;
}

.interpretation-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ios-primary);
    margin-bottom: 8px;
}

.interpretation-section p {
    font-size: 14px;
    color: var(--ios-text);
    line-height: 1.6;
    margin-bottom: 8px;
}

.interpretation-section p:last-child {
    margin-bottom: 0;
}

.interpretation-section strong {
    color: var(--ios-text);
}

/* 设置页面样式 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 15px;
    color: var(--ios-text);
}

.setting-value {
    font-size: 15px;
    color: var(--ios-text-secondary);
}

.setting-item.toggle {
    padding: 8px 0;
}

.toggle-switch {
    position: relative;
    width: 51px;
    height: 31px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(120, 120, 128, 0.16);
    transition: 0.3s;
    border-radius: 31px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--ios-success);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.ios-btn.full-width {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 分享弹窗样式 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.share-modal-content {
    background: white;
    border-radius: 14px 14px 0 0;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

.share-modal-content h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--ios-text);
    font-size: 18px;
    font-weight: 600;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(0, 122, 255, 0.08);
    border: none;
    border-radius: 12px;
    color: var(--ios-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.share-option:active {
    background: rgba(0, 122, 255, 0.2);
    transform: scale(0.95);
}

.share-option i {
    font-size: 28px;
}

.share-option span {
    font-weight: 500;
}

.close-share {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.close-share:active {
    background: rgba(0, 0, 0, 0.1);
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ========== 深色模式样式 ========== */
body.dark-mode {
    --ios-bg: #1c1c1e;
    --ios-card-bg: #2c2c2e;
    --ios-text: #ffffff;
    --ios-text-secondary: #8e8e93;
    --ios-border: #38383a;
    background: linear-gradient(180deg, #1c1c1e 0%, #2c2c2e 100%);
}

body.dark-mode .ios-card {
    background: var(--ios-card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-bar {
    background: rgba(44, 44, 46, 0.9);
}

body.dark-mode .timeline-item,
body.dark-mode .advice-item,
body.dark-mode .year-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .timeline-item:hover,
body.dark-mode .advice-item:hover,
body.dark-mode .year-item:hover {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.3);
}

body.dark-mode .tab-bar {
    background: rgba(44, 44, 46, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .share-modal-content {
    background: var(--ios-card-bg);
}

body.dark-mode .share-modal-content h3 {
    color: #ffffff;
}

body.dark-mode .share-option {
    background: rgba(0, 122, 255, 0.15);
}

body.dark-mode .close-share {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-mode .toast {
    background: rgba(255, 255, 255, 0.9);
    color: #1c1c1e;
}

body.dark-mode .score-circle {
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

body.dark-mode .bar-track {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .time-item.good {
    background: rgba(52, 199, 89, 0.2);
}

body.dark-mode .time-item.normal {
    background: rgba(142, 142, 147, 0.2);
}

body.dark-mode .time-item.bad {
    background: rgba(255, 59, 48, 0.2);
}

body.dark-mode .wuxing-bar {
    background: linear-gradient(to top, rgba(0, 122, 255, 0.2), rgba(88, 86, 214, 0.4));
}

body.dark-mode .profile-card .avatar {
    background: rgba(0, 122, 255, 0.2);
}

body.dark-mode .bazi-value {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .ios-btn {
    background: rgba(0, 122, 255, 0.15);
}

body.dark-mode .ios-btn:hover {
    background: rgba(0, 122, 255, 0.25);
}
