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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: #f5f7fa;
            min-height: 100vh;
            color: #333;
            line-height: 1.5;
            padding-bottom: 60px;
        }

        header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 12px 0;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
        }

        .app-name {
            font-size: 18px;
            font-weight: 600;
            color: white;
        }

        .header-nav {
            display: flex;
            gap: 16px;
        }

        .header-nav .nav-link {
            color: rgba(255,255,255,0.75);
            text-decoration: none;
            font-size: 14px;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.2s;
        }

        .header-nav .nav-link:hover,
        .header-nav .nav-link.active {
            color: white;
            background: rgba(255,255,255,0.15);
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 16px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 12px;
            padding-left: 12px;
            border-left: 3px solid #667eea;
        }

        .card {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            overflow-x: auto;
            padding-bottom: 4px;
        }

        .tab {
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
            background: #f0f0f0;
            color: #666;
            border: none;
            transition: all 0.2s;
        }

        .tab.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .tab:hover:not(.active) {
            background: #e0e0e0;
        }

        /* 月历视图 */
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;
        }

        .calendar-header {
            text-align: center;
            font-size: 12px;
            color: #999;
            padding: 8px 0;
            font-weight: 600;
        }

        .calendar-day {
            aspect-ratio: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            background: #fafafa;
        }

        .calendar-day:hover {
            background: #f0f0f0;
        }

        .calendar-day.today {
            border: 2px solid #667eea;
        }

        .calendar-day.holiday {
            background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
        }

        .calendar-day.other-month {
            color: #ccc;
            background: transparent;
        }

        .holiday-marker {
            position: absolute;
            bottom: 4px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            background: #ff9800;
            color: white;
        }

        .effect-indicator {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            position: absolute;
            top: 4px;
            right: 4px;
        }

        .effect-indicator.up {
            background: #ff4757;
        }

        .effect-indicator.down {
            background: #2ed573;
        }

        /* 周几效应热力图 */
        .weekly-heatmap {
            display: flex;
            gap: 8px;
            margin-top: 16px;
        }

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

        .weekday-label {
            font-size: 12px;
            color: #666;
        }

        .weekday-value {
            width: 100%;
            height: 80px;
            border-radius: 8px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding-bottom: 8px;
            font-size: 12px;
            font-weight: 600;
            color: white;
            position: relative;
            transition: all 0.3s;
        }

        .weekday-value.up {
            background: linear-gradient(180deg, #ff6b6b 0%, #ff4757 100%);
        }

        .weekday-value.down {
            background: linear-gradient(180deg, #7bed9f 0%, #2ed573 100%);
        }

        .weekday-value.neutral {
            background: linear-gradient(180deg, #dfe6e9 0%, #b2bec3 100%);
            color: #666;
        }

        .weekday-value.significant::after {
            content: '★';
            position: absolute;
            top: 4px;
            right: 4px;
            font-size: 10px;
        }

        /* 月份效应柱状图 */
        .monthly-chart {
            display: flex;
            gap: 4px;
            margin-top: 16px;
            height: 120px;
            align-items: flex-end;
        }

        .month-bar {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .month-value {
            width: 100%;
            min-height: 4px;
            border-radius: 4px 4px 0 0;
            transition: all 0.3s;
        }

        .month-value.up {
            background: linear-gradient(180deg, #ff6b6b 0%, #ff4757 100%);
        }

        .month-value.down {
            background: linear-gradient(180deg, #7bed9f 0%, #2ed573 100%);
        }

        .month-value.neutral {
            background: #dfe6e9;
        }

        .month-label {
            font-size: 10px;
            color: #999;
        }

        /* 节假日时间线 */
        .holiday-timeline {
            margin-top: 16px;
        }

        .holiday-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid #f0f0f0;
        }

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

        .holiday-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            background: #f0f0f0;
        }

        .holiday-content {
            flex: 1;
        }

        .holiday-name {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .holiday-dates {
            font-size: 12px;
            color: #999;
            margin-bottom: 8px;
        }

        .holiday-effects {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .effect-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
        }

        .effect-badge.up {
            background: #ffebee;
            color: #c62828;
        }

        .effect-badge.down {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .effect-badge.neutral {
            background: #f5f5f5;
            color: #757575;
        }

        /* 洞察卡片 */
        .insight-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 16px;
            border-radius: 12px;
            margin-bottom: 16px;
        }

        .insight-title {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .insight-list {
            list-style: none;
        }

        .insight-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 0;
            font-size: 13px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }

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

        .insight-icon {
            font-size: 16px;
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            padding-bottom: calc(8px + env(safe-area-inset-bottom));
            border-top: 1px solid #eee;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            font-size: 11px;
            color: #999;
            padding: 4px 12px;
        }

        .nav-item.active {
            color: #667eea;
        }

        .nav-icon {
            font-size: 20px;
        }

        /* 加载状态 */
        .loading {
            text-align: center;
            padding: 40px 20px;
            color: #999;
        }

        .loading-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid #f0f0f0;
            border-top-color: #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 12px;
        }

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

        /* Toast */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            z-index: 1000;
            animation: fadeIn 0.3s;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .toast.success {
            background: #2ed573;
            color: white;
        }

        .toast.error {
            background: #ff4757;
            color: white;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        /* 刷新按钮 */
        .refresh-btn {
            position: fixed;
            bottom: 80px;
            right: 16px;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            font-size: 20px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
            z-index: 50;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .refresh-btn:hover {
            transform: scale(1.1);
        }

        .refresh-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* 图例 */
        .legend {
            display: flex;
            gap: 16px;
            margin-top: 12px;
            font-size: 12px;
            color: #666;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 3px;
        }

        .legend-color.up {
            background: #ff4757;
        }

        .legend-color.down {
            background: #2ed573;
        }

        /* 脚本管理面板 */
        .script-panel {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #f5f7fa;
            z-index: 200;
            display: none;
            overflow-y: auto;
        }

        .script-panel.show {
            display: block;
        }

        .script-panel-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 16px;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .script-panel-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .back-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }

        .script-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 16px;
            padding: 16px;
        }

        .script-card {
            background: white;
            border-radius: 12px;
            padding: 16px;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }

        .script-card:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border-color: #667eea;
        }

        .script-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 8px;
        }

        .script-name {
            font-size: 15px;
            font-weight: 600;
            color: #333;
        }

        .script-category {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
        }

        .script-category.cycle {
            background: #e3f2fd;
            color: #1976d2;
        }

        .script-category.layered {
            background: #f3e5f5;
            color: #7b1fa2;
        }

        .script-description {
            font-size: 13px;
            color: #666;
            margin-bottom: 12px;
            line-height: 1.4;
        }

        .param-section {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin: 16px;
        }

        .param-group {
            margin-bottom: 16px;
        }

        .param-label {
            display: block;
            font-size: 13px;
            color: #666;
            margin-bottom: 6px;
        }

        .param-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            font-size: 14px;
            outline: none;
        }

        .param-input:focus {
            border-color: #667eea;
        }

        .execute-btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .execute-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        .execute-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .progress-section {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin: 16px;
            display: none;
        }

        .progress-section.show {
            display: block;
        }

        .progress-bar-container {
            background: #f0f0f0;
            border-radius: 8px;
            height: 12px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 8px;
            transition: width 0.3s;
        }

        .progress-text {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: #666;
        }

        .result-section {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin: 16px;
            display: none;
        }

        .result-section.show {
            display: block;
        }

        .result-table {
            width: 100%;
            border-collapse: collapse;
        }

        .result-table th,
        .result-table td {
            padding: 10px 12px;
            text-align: left;
            border-bottom: 1px solid #f0f0f0;
        }

        .result-table th {
            font-size: 12px;
            color: #999;
            font-weight: 600;
            background: #f8f9fa;
        }

        .result-table td {
            font-size: 13px;
        }

        .up {
            color: #ff4757;
        }

        .down {
            color: #2ed573;
        }
