马一丁

Optimize the performance of SWOT block dark mode

@@ -2536,6 +2536,32 @@ class HTMLRenderer: @@ -2536,6 +2536,32 @@ class HTMLRenderer:
2536 --engine-query-border: #c7ebd6; 2536 --engine-query-border: #c7ebd6;
2537 --engine-query-text: #1d6b3f; 2537 --engine-query-text: #1d6b3f;
2538 --engine-quote-shadow: 0 12px 30px rgba(0,0,0,0.04); 2538 --engine-quote-shadow: 0 12px 30px rgba(0,0,0,0.04);
  2539 + --swot-strength: #1c7f6e;
  2540 + --swot-weakness: #c0392b;
  2541 + --swot-opportunity: #1f5ab3;
  2542 + --swot-threat: #b36b16;
  2543 + --swot-on-light: #0f1b2b;
  2544 + --swot-on-dark: #f7fbff;
  2545 + --swot-text: #0f1b2b;
  2546 + --swot-muted: rgba(0,0,0,0.65);
  2547 + --swot-surface: rgba(255,255,255,0.86);
  2548 + --swot-chip-bg: rgba(0,0,0,0.06);
  2549 + --swot-tag-border: rgba(0,0,0,0.08);
  2550 + --swot-card-bg: linear-gradient(135deg, rgba(76,132,255,0.06), rgba(28,127,110,0.08)), var(--card-bg);
  2551 + --swot-card-border: var(--border-color);
  2552 + --swot-card-shadow: 0 12px 30px var(--shadow-color);
  2553 + --swot-card-blur: none;
  2554 + --swot-cell-base: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
  2555 + --swot-cell-border: rgba(0,0,0,0.05);
  2556 + --swot-cell-strength-bg: linear-gradient(135deg, rgba(28,127,110,0.08), rgba(255,255,255,0.75)), var(--card-bg);
  2557 + --swot-cell-weakness-bg: linear-gradient(135deg, rgba(192,57,43,0.08), rgba(255,255,255,0.75)), var(--card-bg);
  2558 + --swot-cell-opportunity-bg: linear-gradient(135deg, rgba(31,90,179,0.08), rgba(255,255,255,0.75)), var(--card-bg);
  2559 + --swot-cell-threat-bg: linear-gradient(135deg, rgba(179,107,22,0.08), rgba(255,255,255,0.75)), var(--card-bg);
  2560 + --swot-cell-strength-border: rgba(28,127,110,0.35);
  2561 + --swot-cell-weakness-border: rgba(192,57,43,0.35);
  2562 + --swot-cell-opportunity-border: rgba(31,90,179,0.35);
  2563 + --swot-cell-threat-border: rgba(179,107,22,0.35);
  2564 + --swot-item-border: rgba(0,0,0,0.06);
2539 }} 2565 }}
2540 .dark-mode {{ 2566 .dark-mode {{
2541 --bg-color: #121212; 2567 --bg-color: #121212;
@@ -2560,13 +2586,31 @@ class HTMLRenderer: @@ -2560,13 +2586,31 @@ class HTMLRenderer:
2560 --engine-query-text: #a7e2ba; 2586 --engine-query-text: #a7e2ba;
2561 --engine-quote-shadow: 0 12px 28px rgba(0, 0, 0, 0.35); 2587 --engine-quote-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
2562 --swot-strength: #1c7f6e; 2588 --swot-strength: #1c7f6e;
2563 - --swot-weakness: #c0392b;  
2564 - --swot-opportunity: #1f5ab3;  
2565 - --swot-threat: #b36b16; 2589 + --swot-weakness: #e06754;
  2590 + --swot-opportunity: #5a8cff;
  2591 + --swot-threat: #d48a2c;
2566 --swot-on-light: #0f1b2b; 2592 --swot-on-light: #0f1b2b;
2567 - --swot-on-dark: #f7fbff;  
2568 - --swot-muted: rgba(0,0,0,0.65);  
2569 - --swot-surface: rgba(255,255,255,0.86); 2593 + --swot-on-dark: #e6f0ff;
  2594 + --swot-text: #e6f0ff;
  2595 + --swot-muted: rgba(230,240,255,0.75);
  2596 + --swot-surface: rgba(255,255,255,0.08);
  2597 + --swot-chip-bg: rgba(255,255,255,0.14);
  2598 + --swot-tag-border: rgba(255,255,255,0.24);
  2599 + --swot-card-bg: radial-gradient(140% 140% at 18% 18%, rgba(110,168,254,0.18), transparent 55%), radial-gradient(120% 140% at 82% 0%, rgba(28,127,110,0.16), transparent 52%), linear-gradient(160deg, #0b1424 0%, #0b1f31 52%, #0a1626 100%);
  2600 + --swot-card-border: rgba(255,255,255,0.14);
  2601 + --swot-card-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
  2602 + --swot-card-blur: blur(12px);
  2603 + --swot-cell-base: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  2604 + --swot-cell-border: rgba(255,255,255,0.2);
  2605 + --swot-cell-strength-bg: linear-gradient(150deg, rgba(28,127,110,0.28), rgba(28,127,110,0.12)), var(--swot-cell-base);
  2606 + --swot-cell-weakness-bg: linear-gradient(150deg, rgba(192,57,43,0.32), rgba(192,57,43,0.14)), var(--swot-cell-base);
  2607 + --swot-cell-opportunity-bg: linear-gradient(150deg, rgba(31,90,179,0.28), rgba(31,90,179,0.12)), var(--swot-cell-base);
  2608 + --swot-cell-threat-bg: linear-gradient(150deg, rgba(179,107,22,0.32), rgba(179,107,22,0.14)), var(--swot-cell-base);
  2609 + --swot-cell-strength-border: rgba(28,127,110,0.65);
  2610 + --swot-cell-weakness-border: rgba(192,57,43,0.68);
  2611 + --swot-cell-opportunity-border: rgba(31,90,179,0.68);
  2612 + --swot-cell-threat-border: rgba(179,107,22,0.68);
  2613 + --swot-item-border: rgba(255,255,255,0.14);
2570 }} 2614 }}
2571 * {{ box-sizing: border-box; }} 2615 * {{ box-sizing: border-box; }}
2572 body {{ 2616 body {{
@@ -3011,10 +3055,13 @@ table th {{ @@ -3011,10 +3055,13 @@ table th {{
3011 margin: 26px 0; 3055 margin: 26px 0;
3012 padding: 18px 18px 14px; 3056 padding: 18px 18px 14px;
3013 border-radius: 16px; 3057 border-radius: 16px;
3014 - border: 1px solid var(--border-color);  
3015 - background: linear-gradient(135deg, rgba(76,132,255,0.06), rgba(28,127,110,0.08)), var(--card-bg);  
3016 - box-shadow: 0 12px 30px var(--shadow-color);  
3017 - color: var(--swot-on-light); 3058 + border: 1px solid var(--swot-card-border);
  3059 + background: var(--swot-card-bg);
  3060 + box-shadow: var(--swot-card-shadow);
  3061 + color: var(--swot-text);
  3062 + backdrop-filter: var(--swot-card-blur);
  3063 + position: relative;
  3064 + overflow: hidden;
3018 }} 3065 }}
3019 .swot-card__head {{ 3066 .swot-card__head {{
3020 display: flex; 3067 display: flex;
@@ -3030,8 +3077,8 @@ table th {{ @@ -3030,8 +3077,8 @@ table th {{
3030 }} 3077 }}
3031 .swot-card__summary {{ 3078 .swot-card__summary {{
3032 margin: 0; 3079 margin: 0;
3033 - color: var(--text-color);  
3034 - opacity: 0.85; 3080 + color: var(--swot-text);
  3081 + opacity: 0.82;
3035 }} 3082 }}
3036 .swot-legend {{ 3083 .swot-legend {{
3037 display: flex; 3084 display: flex;
@@ -3043,9 +3090,10 @@ table th {{ @@ -3043,9 +3090,10 @@ table th {{
3043 padding: 6px 12px; 3090 padding: 6px 12px;
3044 border-radius: 999px; 3091 border-radius: 999px;
3045 font-weight: 700; 3092 font-weight: 700;
3046 - color: var(--swot-on-light);  
3047 - border: 1px solid rgba(255,255,255,0.18);  
3048 - box-shadow: 0 4px 10px rgba(0,0,0,0.12); 3093 + color: var(--swot-on-dark);
  3094 + border: 1px solid var(--swot-tag-border);
  3095 + box-shadow: 0 4px 12px rgba(0,0,0,0.16);
  3096 + text-shadow: 0 1px 2px rgba(0,0,0,0.35);
3049 }} 3097 }}
3050 .swot-legend__item.strength {{ background: var(--swot-strength); }} 3098 .swot-legend__item.strength {{ background: var(--swot-strength); }}
3051 .swot-legend__item.weakness {{ background: var(--swot-weakness); }} 3099 .swot-legend__item.weakness {{ background: var(--swot-weakness); }}
@@ -3059,15 +3107,15 @@ table th {{ @@ -3059,15 +3107,15 @@ table th {{
3059 }} 3107 }}
3060 .swot-cell {{ 3108 .swot-cell {{
3061 border-radius: 14px; 3109 border-radius: 14px;
3062 - border: 1px solid rgba(0,0,0,0.05); 3110 + border: 1px solid var(--swot-cell-border);
3063 padding: 12px 12px 10px; 3111 padding: 12px 12px 10px;
3064 - background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));  
3065 - box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); 3112 + background: var(--swot-cell-base);
  3113 + box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
3066 }} 3114 }}
3067 -.swot-cell.strength {{ border-color: rgba(28,127,110,0.35); background: linear-gradient(135deg, rgba(28,127,110,0.08), rgba(255,255,255,0.75)), var(--card-bg); }}  
3068 -.swot-cell.weakness {{ border-color: rgba(192,57,43,0.35); background: linear-gradient(135deg, rgba(192,57,43,0.08), rgba(255,255,255,0.75)), var(--card-bg); }}  
3069 -.swot-cell.opportunity {{ border-color: rgba(31,90,179,0.35); background: linear-gradient(135deg, rgba(31,90,179,0.08), rgba(255,255,255,0.75)), var(--card-bg); }}  
3070 -.swot-cell.threat {{ border-color: rgba(179,107,22,0.35); background: linear-gradient(135deg, rgba(179,107,22,0.08), rgba(255,255,255,0.75)), var(--card-bg); }} 3115 +.swot-cell.strength {{ border-color: var(--swot-cell-strength-border); background: var(--swot-cell-strength-bg); }}
  3116 +.swot-cell.weakness {{ border-color: var(--swot-cell-weakness-border); background: var(--swot-cell-weakness-bg); }}
  3117 +.swot-cell.opportunity {{ border-color: var(--swot-cell-opportunity-border); background: var(--swot-cell-opportunity-bg); }}
  3118 +.swot-cell.threat {{ border-color: var(--swot-cell-threat-border); background: var(--swot-cell-threat-bg); }}
3071 .swot-cell__meta {{ 3119 .swot-cell__meta {{
3072 display: flex; 3120 display: flex;
3073 gap: 10px; 3121 gap: 10px;
@@ -3082,9 +3130,9 @@ table th {{ @@ -3082,9 +3130,9 @@ table th {{
3082 height: 36px; 3130 height: 36px;
3083 border-radius: 12px; 3131 border-radius: 12px;
3084 font-weight: 800; 3132 font-weight: 800;
3085 - color: var(--swot-on-light);  
3086 - border: 1px solid rgba(255,255,255,0.2);  
3087 - box-shadow: 0 6px 16px rgba(0,0,0,0.14); 3133 + color: var(--swot-on-dark);
  3134 + border: 1px solid var(--swot-tag-border);
  3135 + box-shadow: 0 8px 20px rgba(0,0,0,0.18);
3088 }} 3136 }}
3089 .swot-pill.strength {{ background: var(--swot-strength); }} 3137 .swot-pill.strength {{ background: var(--swot-strength); }}
3090 .swot-pill.weakness {{ background: var(--swot-weakness); }} 3138 .swot-pill.weakness {{ background: var(--swot-weakness); }}
@@ -3093,10 +3141,11 @@ table th {{ @@ -3093,10 +3141,11 @@ table th {{
3093 .swot-cell__title {{ 3141 .swot-cell__title {{
3094 font-weight: 750; 3142 font-weight: 750;
3095 letter-spacing: 0.01em; 3143 letter-spacing: 0.01em;
  3144 + color: var(--swot-text);
3096 }} 3145 }}
3097 .swot-cell__caption {{ 3146 .swot-cell__caption {{
3098 font-size: 0.9rem; 3147 font-size: 0.9rem;
3099 - color: var(--text-color); 3148 + color: var(--swot-text);
3100 opacity: 0.7; 3149 opacity: 0.7;
3101 }} 3150 }}
3102 .swot-list {{ 3151 .swot-list {{
@@ -3111,13 +3160,15 @@ table th {{ @@ -3111,13 +3160,15 @@ table th {{
3111 padding: 10px 12px; 3160 padding: 10px 12px;
3112 border-radius: 12px; 3161 border-radius: 12px;
3113 background: var(--swot-surface); 3162 background: var(--swot-surface);
3114 - border: 1px dashed rgba(0,0,0,0.06); 3163 + border: 1px solid var(--swot-item-border);
  3164 + box-shadow: 0 12px 22px rgba(0,0,0,0.08);
3115 }} 3165 }}
3116 .swot-item-title {{ 3166 .swot-item-title {{
3117 display: flex; 3167 display: flex;
3118 justify-content: space-between; 3168 justify-content: space-between;
3119 gap: 8px; 3169 gap: 8px;
3120 font-weight: 650; 3170 font-weight: 650;
  3171 + color: var(--swot-text);
3121 }} 3172 }}
3122 .swot-item-tags {{ 3173 .swot-item-tags {{
3123 display: inline-flex; 3174 display: inline-flex;
@@ -3129,27 +3180,30 @@ table th {{ @@ -3129,27 +3180,30 @@ table th {{
3129 display: inline-block; 3180 display: inline-block;
3130 padding: 4px 8px; 3181 padding: 4px 8px;
3131 border-radius: 10px; 3182 border-radius: 10px;
3132 - background: rgba(0,0,0,0.06);  
3133 - color: var(--swot-on-light); 3183 + background: var(--swot-chip-bg);
  3184 + color: var(--swot-text);
  3185 + border: 1px solid var(--swot-tag-border);
  3186 + box-shadow: 0 6px 14px rgba(0,0,0,0.12);
3134 line-height: 1.2; 3187 line-height: 1.2;
3135 }} 3188 }}
3136 .swot-tag.neutral {{ 3189 .swot-tag.neutral {{
3137 - background: rgba(0,0,0,0.04); 3190 + opacity: 0.9;
3138 }} 3191 }}
3139 .swot-item-desc {{ 3192 .swot-item-desc {{
3140 margin-top: 4px; 3193 margin-top: 4px;
3141 - color: var(--text-color);  
3142 - opacity: 0.94; 3194 + color: var(--swot-text);
  3195 + opacity: 0.92;
3143 }} 3196 }}
3144 .swot-item-evidence {{ 3197 .swot-item-evidence {{
3145 margin-top: 4px; 3198 margin-top: 4px;
3146 font-size: 0.9rem; 3199 font-size: 0.9rem;
3147 color: var(--secondary-color); 3200 color: var(--secondary-color);
  3201 + opacity: 0.94;
3148 }} 3202 }}
3149 .swot-empty {{ 3203 .swot-empty {{
3150 padding: 12px; 3204 padding: 12px;
3151 border-radius: 12px; 3205 border-radius: 12px;
3152 - border: 1px dashed var(--border-color); 3206 + border: 1px dashed var(--swot-card-border);
3153 text-align: center; 3207 text-align: center;
3154 color: var(--swot-muted); 3208 color: var(--swot-muted);
3155 opacity: 0.7; 3209 opacity: 0.7;
@@ -3408,7 +3462,7 @@ blockquote {{ @@ -3408,7 +3462,7 @@ blockquote {{
3408 page-break-inside: avoid; 3462 page-break-inside: avoid;
3409 }} 3463 }}
3410 .swot-card {{ 3464 .swot-card {{
3411 - color: var(--swot-on-dark); 3465 + color: var(--swot-text);
3412 }} 3466 }}
3413 .table-wrap {{ 3467 .table-wrap {{
3414 overflow-x: auto; 3468 overflow-x: auto;
@@ -3436,37 +3490,34 @@ img, canvas, svg {{ @@ -3436,37 +3490,34 @@ img, canvas, svg {{
3436 }} 3490 }}
3437 }} 3491 }}
3438 3492
3439 -/* 颜色模式自适应:在暗色环境下提升SWOT文本对比度 */ 3493 +/* 深色系统偏好下,同步SWOT的玻璃态配色与文字对比度 */
3440 @media (prefers-color-scheme: dark) {{ 3494 @media (prefers-color-scheme: dark) {{
3441 - .swot-card {{  
3442 - color: var(--swot-on-dark);  
3443 - background: linear-gradient(135deg, rgba(36,64,110,0.52), rgba(19,88,73,0.48));  
3444 - border-color: rgba(255,255,255,0.1);  
3445 - box-shadow: 0 12px 30px rgba(0,0,0,0.4);  
3446 - }}  
3447 - .swot-legend__item,  
3448 - .swot-pill,  
3449 - .swot-item,  
3450 - .swot-tag {{  
3451 - color: var(--swot-on-dark);  
3452 - }}  
3453 - .swot-cell {{  
3454 - background: rgba(255,255,255,0.05);  
3455 - border-color: rgba(255,255,255,0.14);  
3456 - }}  
3457 - .swot-cell.strength {{ background: linear-gradient(135deg, rgba(28,127,110,0.28), rgba(28,127,110,0.12)); border-color: rgba(28,127,110,0.65); }}  
3458 - .swot-cell.weakness {{ background: linear-gradient(135deg, rgba(192,57,43,0.28), rgba(192,57,43,0.12)); border-color: rgba(192,57,43,0.65); }}  
3459 - .swot-cell.opportunity {{ background: linear-gradient(135deg, rgba(31,90,179,0.28), rgba(31,90,179,0.12)); border-color: rgba(31,90,179,0.65); }}  
3460 - .swot-cell.threat {{ background: linear-gradient(135deg, rgba(179,107,22,0.28), rgba(179,107,22,0.12)); border-color: rgba(179,107,22,0.65); }}  
3461 - .swot-item {{  
3462 - background: rgba(255,255,255,0.06);  
3463 - border-color: rgba(255,255,255,0.16);  
3464 - }}  
3465 - .swot-tag {{  
3466 - background: rgba(255,255,255,0.12);  
3467 - }}  
3468 - .swot-item-evidence {{  
3469 - color: color-mix(in srgb, var(--secondary-color) 75%, #ffffff 25%); 3495 + :root {{
  3496 + --swot-strength: #1c7f6e;
  3497 + --swot-weakness: #e06754;
  3498 + --swot-opportunity: #5a8cff;
  3499 + --swot-threat: #d48a2c;
  3500 + --swot-on-dark: #e6f0ff;
  3501 + --swot-text: #e6f0ff;
  3502 + --swot-muted: rgba(230,240,255,0.75);
  3503 + --swot-surface: rgba(255,255,255,0.08);
  3504 + --swot-chip-bg: rgba(255,255,255,0.14);
  3505 + --swot-tag-border: rgba(255,255,255,0.24);
  3506 + --swot-card-bg: radial-gradient(140% 140% at 18% 18%, rgba(110,168,254,0.18), transparent 55%), radial-gradient(120% 140% at 82% 0%, rgba(28,127,110,0.16), transparent 52%), linear-gradient(160deg, #0b1424 0%, #0b1f31 52%, #0a1626 100%);
  3507 + --swot-card-border: rgba(255,255,255,0.14);
  3508 + --swot-card-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
  3509 + --swot-card-blur: blur(12px);
  3510 + --swot-cell-base: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  3511 + --swot-cell-border: rgba(255,255,255,0.2);
  3512 + --swot-cell-strength-bg: linear-gradient(150deg, rgba(28,127,110,0.28), rgba(28,127,110,0.12)), var(--swot-cell-base);
  3513 + --swot-cell-weakness-bg: linear-gradient(150deg, rgba(192,57,43,0.32), rgba(192,57,43,0.14)), var(--swot-cell-base);
  3514 + --swot-cell-opportunity-bg: linear-gradient(150deg, rgba(31,90,179,0.28), rgba(31,90,179,0.12)), var(--swot-cell-base);
  3515 + --swot-cell-threat-bg: linear-gradient(150deg, rgba(179,107,22,0.32), rgba(179,107,22,0.14)), var(--swot-cell-base);
  3516 + --swot-cell-strength-border: rgba(28,127,110,0.65);
  3517 + --swot-cell-weakness-border: rgba(192,57,43,0.68);
  3518 + --swot-cell-opportunity-border: rgba(31,90,179,0.68);
  3519 + --swot-cell-threat-border: rgba(179,107,22,0.68);
  3520 + --swot-item-border: rgba(255,255,255,0.14);
3470 }} 3521 }}
3471 }} 3522 }}
3472 """ 3523 """