File size: 34,443 Bytes
80b1205 350a4b5 80b1205 350a4b5 80b1205 d5d3bda 80b1205 350a4b5 d5d3bda 350a4b5 80b1205 350a4b5 d5d3bda 350a4b5 80b1205 b263ce0 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 b263ce0 80b1205 b263ce0 80b1205 b263ce0 80b1205 b263ce0 80b1205 b263ce0 350a4b5 b263ce0 350a4b5 b263ce0 80b1205 350a4b5 80b1205 350a4b5 80b1205 350a4b5 80b1205 d5d3bda 80b1205 d5d3bda 80b1205 350a4b5 80b1205 d5d3bda 80b1205 350a4b5 80b1205 350a4b5 80b1205 d5d3bda 350a4b5 80b1205 b263ce0 350a4b5 b263ce0 f0bce66 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 | /* BookRank Base Styles - Professional Business Theme with Full Dark Mode Support */
/* CSS Custom Properties - Vercel Design System Tokens */
:root {
/* Primary Colors - Vercel Black & White */
--primary-color: #171717;
--primary-light: #fafafa;
--primary-dark: #000000;
--primary-gradient: linear-gradient(135deg, #171717 0%, #000000 100%);
/* Vercel Color Palette */
--black: #171717;
--white: #ffffff;
--gray-50: #fafafa;
--gray-100: #ebebeb;
--gray-400: #808080;
--gray-500: #666666;
--gray-600: #4d4d4d;
/* WCAG AA 修正(第二轮实测):#0072f5 作正文/链接色时白底 4.44:1、
--gray-50(#fafafa) 底 4.26:1,均低于 4.5:1。
#006ee8 是**刚好达标的最浅值**(白底 4.78:1、#fafafa 底 4.58:1),
色相与观感尽量贴近原色,把设计改动压到最小。 */
--link-blue: #006ee8;
--focus-blue: hsl(212,100%,48%);
--ship-red: #ff5b4f;
--preview-pink: #de1d8d;
--develop-blue: #0a72ef;
--console-blue: #0070f3;
--console-purple: #7928ca;
--console-pink: #eb367f;
--badge-bg: #ebf5ff;
--badge-text: #0068d6;
/* Background Colors - Light Mode */
--bg-primary: var(--white);
--bg-secondary: var(--gray-50);
--bg-tertiary: var(--gray-100);
--bg-light: var(--white);
--bg-white: var(--white);
--bg-card: var(--white);
--card-bg: var(--white);
/* Text Colors - Light Mode */
--text-primary: var(--black);
--text-secondary: var(--gray-600);
--text-light: var(--gray-500);
--text-white: var(--white);
/* WCAG AA 修正(dsh-design-audit 实测):--gray-400(#808080) 作正文色时
白底仅 3.95:1、--gray-50(#fafafa) 底仅 3.78:1,均低于正文所需的 4.5:1。
这里改为专用文字色 #707070(白底 4.95:1、#fafafa 底 4.75:1)。
注意:不改 --gray-400 本身 —— 它还被 --accent-silver 渐变引用,
改调色板会连带动到非文字用途。 */
--text-muted: #707070;
--text-gold: #b8860b;
/* Border Colors */
--border-color: var(--gray-100);
--border-light: var(--gray-50);
/* Warning state (search/load failure banners) - light */
--state-warning-border: #d6a94f;
--state-warning-tint: #fdf6ec;
/* Accent Colors - Vercel Workflow Colors */
--accent-silver: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-600) 100%);
--accent-bronze: linear-gradient(135deg, var(--console-purple) 0%, var(--console-pink) 100%);
--accent-gold: linear-gradient(135deg, var(--develop-blue) 0%, var(--console-blue) 100%);
--accent-red: var(--ship-red);
--accent-green: #10b981;
--accent-blue: var(--link-blue);
--accent-purple: var(--console-purple);
/* Shadows - Vercel Style */
--shadow-ring: rgba(0,0,0,0.08) 0px 0px 0px 1px;
--shadow-ring-light: rgb(235,235,235) 0px 0px 0px 1px;
--shadow-subtle: rgba(0,0,0,0.04) 0px 2px 2px 0px;
--shadow-sm: var(--shadow-ring-light);
--shadow-md: var(--shadow-card);
--shadow-lg: var(--shadow-card-full);
--shadow-xl: var(--shadow-card-full);
--shadow-hover: var(--shadow-card-full);
--shadow-card: rgba(0,0,0,0.08) 0px 0px 0px 1px, rgba(0,0,0,0.04) 0px 2px 2px 0px, rgb(250,250,250) 0px 0px 0px 1px;
--shadow-card-full: rgba(0,0,0,0.08) 0px 0px 0px 1px, rgba(0,0,0,0.04) 0px 2px 2px 0px, rgba(0,0,0,0.04) 0px 8px 8px -8px, rgb(250,250,250) 0px 0px 0px 1px;
/* Spacing - Vercel Scale */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 1.5rem;
--spacing-xl: 2rem;
--spacing-2xl: 2.5rem;
/* Border Radius - Vercel Scale */
--radius-sm: 2px;
--radius-md: 4px;
--radius-lg: 6px;
--radius-xl: 8px;
--radius-full: 9999px;
/* Transitions - Smooth and natural */
--transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
--transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
--transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
/* Fonts - Vercel Style */
--font-sans: 'Geist', system-ui, -apple-system, Arial, sans-serif;
--font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, 'Roboto Mono', Menlo, monospace;
/* Layout */
--sidebar-width: 260px;
--top-nav-height: 64px;
}
/* Dark Theme - System Preference + Manual Toggle */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--primary-color: #ff6b35;
--primary-light: rgba(255, 107, 53, 0.15);
--primary-dark: #e55a2b;
--primary-gradient: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
--white: #1a1d22;
--badge-bg: #1b2531;
--badge-text: #7fb2ff;
/* 三层背景深度:页面最深 → 侧边栏中等 → 卡片最亮(中性炭灰,无蓝调) */
--bg-primary: #0f1115;
--bg-secondary: #14161a;
--bg-tertiary: #1a1d22;
--bg-light: #0f1115;
--bg-white: #14161a;
--bg-card: #14161a;
--card-bg: #1a1d22;
/* 文字层级:主/次/弱 */
--text-primary: #e9ebee;
--text-secondary: #a9aeb8;
--text-light: #a9aeb8;
--text-muted: #71767f;
--text-gold: #f7c948;
/* 边框:强(结构线)/ 弱(次级分隔) */
--border-color: #262a31;
--border-light: #1f2228;
/* 警告态(搜索/加载失败横幅)- 暗色 */
--state-warning-border: #8a6d2f;
--state-warning-tint: #1c1a14;
/* 暗色下重模糊阴影发糊,改用细描边环 */
--shadow-ring: 0 0 0 1px var(--border-color);
--shadow-ring-light: 0 0 0 1px var(--border-light);
--shadow-sm: 0 0 0 1px var(--border-color);
--shadow-md: 0 0 0 1px var(--border-color);
--shadow-lg: 0 0 0 1px var(--border-color);
--shadow-card: 0 0 0 1px var(--border-color);
--shadow-card-full: 0 0 0 1px var(--border-color);
}
}
/* Manual Dark Theme Override */
[data-theme="dark"] {
--primary-color: #ff6b35;
--primary-light: rgba(255, 107, 53, 0.15);
--primary-dark: #e55a2b;
--primary-gradient: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
--white: #1a1d22;
--badge-bg: #1b2531;
--badge-text: #7fb2ff;
/* 三层背景深度:页面最深 → 侧边栏中等 → 卡片最亮(中性炭灰,无蓝调) */
--bg-primary: #0f1115;
--bg-secondary: #14161a;
--bg-tertiary: #1a1d22;
--bg-light: #0f1115;
--bg-white: #14161a;
--bg-card: #14161a;
--card-bg: #1a1d22;
/* 文字层级:主/次/弱 */
--text-primary: #e9ebee;
--text-secondary: #a9aeb8;
--text-light: #a9aeb8;
--text-muted: #71767f;
--text-gold: #f7c948;
/* 边框:强(结构线)/ 弱(次级分隔) */
--border-color: #262a31;
--border-light: #1f2228;
/* 警告态(搜索/加载失败横幅)- 暗色 */
--state-warning-border: #8a6d2f;
--state-warning-tint: #1c1a14;
/* 暗色下重模糊阴影发糊,改用细描边环 */
--shadow-ring: 0 0 0 1px var(--border-color);
--shadow-ring-light: 0 0 0 1px var(--border-light);
--shadow-sm: 0 0 0 1px var(--border-color);
--shadow-md: 0 0 0 1px var(--border-color);
--shadow-lg: 0 0 0 1px var(--border-color);
--shadow-card: 0 0 0 1px var(--border-color);
--shadow-card-full: 0 0 0 1px var(--border-color);
}
/* Reset & Base */
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 16px;
scroll-behavior: smooth;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
font-family: var(--font-sans);
font-size: 1rem;
line-height: 1.5;
color: var(--text-primary);
background-color: var(--bg-light);
min-height: 100vh;
font-feature-settings: "liga" 1;
-webkit-font-smoothing: antialiased;
contain: layout style;
}
/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
html { scroll-behavior: auto; }
}
/* Links */
a {
text-decoration: none;
color: inherit;
transition: color var(--transition-fast);
}
/* Buttons */
button {
border: none;
background: none;
cursor: pointer;
font-family: inherit;
}
/* Images */
img {
max-width: 100%;
height: auto;
display: block;
}
/* Typography */
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
line-height: 1.3;
color: var(--text-primary);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
/* Utility Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-gold { color: var(--text-gold); }
.text-white { color: var(--text-white); }
/* Layout */
.app-container {
display: flex;
min-height: 100vh;
}
.main-content {
flex: 1;
margin-left: var(--sidebar-width);
padding: var(--spacing-lg);
padding-top: calc(var(--top-nav-height) + var(--spacing-lg));
transition: margin-left var(--transition-normal);
background-color: var(--bg-light);
}
/* 平板端 & 手机端:侧边栏不固定,主内容区占满 */
@media (max-width: 1199px) {
.main-content {
margin-left: 0;
padding: var(--spacing-md);
padding-top: calc(var(--top-nav-height) + var(--spacing-md));
}
}
/* Top Navigation - Vercel Style */
.top-nav {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--top-nav-height);
background: var(--bg-card);
backdrop-filter: blur(12px);
box-shadow: var(--shadow-ring);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
padding: 0 var(--spacing-lg);
z-index: 1000;
transition: background-color var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.nav-brand {
display: flex;
align-items: center;
gap: var(--spacing-sm);
/* WCAG 2.5.8:实测命中区 91.38×21px,高度低于 24px 下限 */
min-height: 24px;
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
letter-spacing: -0.28px;
}
.nav-brand svg {
color: var(--primary-color);
}
.nav-links {
display: flex;
align-items: center;
gap: 8px;
margin-left: var(--spacing-lg);
list-style: none;
}
/* 导航项:统一 36px 高度节奏(图标 16px + 6px 间距 + 13px 标签) */
.nav-link {
display: flex;
align-items: center;
gap: 6px;
height: 36px;
padding: 0 10px;
border-radius: 4px;
transition: background-color var(--transition-fast), border-color var(--transition-fast);
color: var(--text-secondary);
font-size: 13px;
font-weight: 500;
text-decoration: none;
}
.nav-link svg {
width: 16px;
height: 16px;
}
/* 悬停:仅底色变化,不下划线、不跳色(颜色保持 --text-secondary) */
.nav-link:hover,
.nav-link:focus {
background-color: var(--bg-tertiary);
}
/* 当前页:模板输出 .active 类 + aria-current="page"(两者同选,避免新增类) */
.nav-link.active,
.nav-link[aria-current="page"] {
color: var(--text-primary);
background-color: var(--bg-tertiary);
font-weight: 600;
}
.nav-link:focus-visible {
outline: 2px solid var(--focus-blue);
outline-offset: 2px;
}
.nav-actions {
margin-left: auto;
display: flex;
justify-content: flex-end;
gap: 8px;
align-items: center;
}
/* Language Switcher - Globe Dropdown */
.language-switcher {
position: relative;
display: flex;
align-items: center;
}
/* 语言切换按钮:与主题按钮同尺寸同描边(36px / radius 4px / 透明底) */
.lang-globe-btn {
display: flex;
align-items: center;
gap: 6px;
height: 36px;
padding: 0 10px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: transparent;
color: var(--text-secondary);
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.lang-globe-btn:hover,
.lang-globe-btn:focus {
border-color: var(--text-muted);
background: transparent;
color: var(--text-primary);
}
.lang-globe-btn .icon {
width: 16px;
height: 16px;
}
.lang-current {
font-size: 0.75rem;
min-width: 16px;
text-align: center;
}
.lang-dropdown {
position: absolute;
top: calc(100% + 6px);
right: 0;
min-width: 180px;
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
padding: 6px;
z-index: 1000;
opacity: 0;
visibility: hidden;
transform: translateY(-4px);
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.lang-dropdown.open {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.lang-option {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 8px 10px;
border: none;
border-radius: var(--radius-md);
background: transparent;
color: var(--text-primary);
font-size: 0.875rem;
cursor: pointer;
transition: background 0.15s ease;
text-align: left;
}
.lang-option:hover {
background: var(--bg-tertiary);
}
.lang-option.active {
background: var(--badge-bg);
color: var(--badge-text);
}
.lang-option.active .lang-check {
opacity: 1;
}
.lang-flag {
font-size: 0.75rem;
font-weight: 600;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-tertiary);
border-radius: var(--radius-md);
color: var(--text-secondary);
flex-shrink: 0;
}
.lang-name {
flex: 1;
font-weight: 500;
}
.lang-check {
width: 16px;
height: 16px;
opacity: 0;
color: var(--badge-text);
transition: opacity 0.15s ease;
}
.lang-divider-line {
height: 1px;
background: var(--border-color);
margin: 6px 0;
}
.lang-coming-soon {
padding: 6px 10px;
font-size: 0.75rem;
color: var(--text-muted);
text-align: center;
}
/* Backward compatibility: old lang-btn style */
.lang-btn {
padding: var(--spacing-xs) var(--spacing-sm);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
background: var(--bg-card);
color: var(--text-secondary);
font-size: 0.8125rem;
font-weight: 600;
cursor: pointer;
transition: var(--transition-normal);
}
.lang-btn.active {
background: var(--badge-bg);
color: var(--badge-text);
border-color: var(--badge-text);
}
.lang-divider {
color: var(--text-muted);
margin: 0 2px;
}
.nav-cta {
display: inline-block;
background: var(--primary-color);
color: var(--text-white);
padding: 8px 16px;
border-radius: var(--radius-lg);
font-size: 14px;
font-weight: 500;
text-decoration: none;
transition: opacity var(--transition-fast);
}
.nav-cta:hover {
opacity: 0.85;
}
/* Sidebar - Vercel Style */
.sidebar {
position: fixed;
left: 0;
top: var(--top-nav-height);
bottom: 0;
width: var(--sidebar-width);
background-color: var(--bg-white);
box-shadow: var(--shadow-ring);
padding: var(--spacing-lg);
overflow-y: auto;
transition: transform var(--transition-normal), background-color var(--transition-normal);
z-index: 999;
}
.sidebar.open { transform: translateX(0); }
/* 平板端 & 手机端:侧边栏默认隐藏,可通过按钮切换 */
@media (max-width: 1199px) {
.sidebar {
transform: translateX(-100%);
width: 80vw;
max-width: 300px;
}
/* 侧边栏展开时添加遮罩层 */
.sidebar.open::before {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: -1;
pointer-events: auto;
}
}
.sidebar-section { margin-bottom: var(--spacing-xl); }
.sidebar-title {
font-family: var(--font-mono);
font-size: 12px;
font-weight: 500;
color: var(--text-muted);
text-transform: uppercase;
margin-bottom: var(--spacing-md);
letter-spacing: 0.5px;
}
.sidebar-menu { list-style: none; }
.sidebar-item { margin-bottom: var(--spacing-xs); }
.sidebar-link {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-md);
border-radius: var(--radius-lg);
transition: all var(--transition-fast);
color: var(--text-secondary);
font-size: 14px;
font-weight: 500;
text-decoration: none;
}
.sidebar-link:hover,
.sidebar-link:focus {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.sidebar-link.active {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.sidebar-link:focus-visible {
outline: 2px solid var(--focus-blue);
outline-offset: 2px;
}
.sidebar-link svg {
width: 18px;
height: 18px;
}
/* Sidebar Toggle - Vercel Style */
.sidebar-toggle {
position: fixed;
left: var(--spacing-lg);
top: calc(var(--top-nav-height) + var(--spacing-md));
z-index: 998;
background-color: var(--bg-white);
border: none;
border-radius: var(--radius-lg);
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-ring-light);
transition: all var(--transition-fast);
}
.sidebar-toggle:hover,
.sidebar-toggle:focus {
background-color: var(--bg-tertiary);
box-shadow: var(--shadow-ring);
}
.sidebar-toggle:focus-visible {
outline: 2px solid var(--focus-blue);
outline-offset: 2px;
}
/* 桌面端(≥1200px)隐藏侧边栏切换按钮,侧边栏始终可见 */
@media (min-width: 1200px) { .sidebar-toggle { display: none; } }
/* ============================================
* 平板端导航优化 (768px-1199px)
* ============================================ */
@media (min-width: 768px) and (max-width: 1199px) {
.top-nav {
padding: 0 var(--spacing-md);
}
/* 间距节奏保持全站一致(8px),仅收窄内边距与字号以适配窄屏 */
.nav-link {
padding: 0 8px;
font-size: 13px;
}
.nav-link span {
display: inline;
}
}
/* ============================================
* 手机端导航栏优化 (≤767px)
* ============================================ */
@media (max-width: 767px) {
:root {
/* 修复(dsh-design-audit 实测):原值为 `auto`。而 --top-nav-height 被用于
`calc(var(--top-nav-height) + …)`(.sidebar-toggle 的 top、主内容 padding-top 等)——
把长度变量设成 auto 会让整个 calc() **非法**,声明被浏览器丢弃,于是
.sidebar-toggle 的 top 退回 auto,position:fixed 的按钮落到 y≈0 的导航条区域内,
被 z-index 1000 的 .top-nav 完全覆盖(实测 6 个采样点全部命中导航/品牌文字,
用户点不到侧栏开关)。取值与下方 .top-nav 的 min-height 保持一致。 */
--top-nav-height: 56px;
}
.top-nav {
height: auto;
min-height: 56px;
padding: var(--spacing-xs) var(--spacing-sm);
flex-wrap: wrap;
gap: var(--spacing-xs);
}
.nav-brand {
font-size: 1rem;
order: 1;
flex-shrink: 0;
}
.nav-brand svg {
width: 22px;
height: 22px;
}
.nav-links {
order: 3;
width: 100%;
margin-left: 0;
margin-top: var(--spacing-xs);
gap: var(--spacing-xs);
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
-ms-overflow-style: none;
padding-bottom: var(--spacing-xs);
flex-wrap: nowrap;
}
.nav-links::-webkit-scrollbar {
display: none;
}
/* 移动端仍是横向滚动条:胶囊外观 + 36px 触控高度(保留原有 0.8rem 字号) */
.nav-link {
padding: 0 var(--spacing-sm);
font-size: 0.8rem;
white-space: nowrap;
flex-shrink: 0;
border-radius: var(--radius-full);
}
.nav-link span {
display: none;
}
.nav-link svg {
width: 20px;
height: 20px;
}
.nav-actions {
order: 2;
margin-left: auto;
gap: var(--spacing-xs);
flex-shrink: 0;
}
.language-switcher {
font-size: 0.75rem;
}
/* 尺寸由 .top-nav .lang-globe-btn 统一(窄屏 44px 产品目标触控高度);此处只降字号 */
.lang-globe-btn {
font-size: 0.75rem;
}
.lang-btn {
padding: var(--spacing-xs) var(--spacing-sm);
font-size: 0.75rem;
min-width: 32px;
min-height: 32px;
}
/* 主题按钮尺寸同样由 .top-nav .btn-icon#theme-toggle 统一(窄屏 44px 产品目标触控高度) */
.main-content {
padding-top: calc(70px + var(--spacing-sm));
}
}
@media (max-width: 480px) {
.top-nav {
padding: var(--spacing-xs) var(--spacing-xs);
gap: 2px;
}
.nav-brand {
font-size: 0.9rem;
gap: 2px;
}
.nav-brand svg {
width: 18px;
height: 18px;
}
.nav-link svg {
width: 16px;
height: 16px;
}
/* 尺寸统一由下表 .top-nav 规则接管(窄屏 44px 产品目标 / radius 4px / 边框),此处只降字号 */
.lang-globe-btn {
font-size: 0.7rem;
}
.lang-globe-btn .icon {
width: 16px;
height: 16px;
}
.lang-btn {
font-size: 0.7rem;
padding: 2px 6px;
}
}
/* ============================================
* 窄屏全局导航(native <dialog>)
* ≤900px:顶栏菜单按钮打开 #site-nav-dialog,承载六个主导航链接;
* 图标导航行与旧侧边栏在此区间隐藏,窄屏只暴露一个导航菜单。
* ============================================ */
/* 全局菜单按钮:仅窄屏显示;样式与顶栏其余控件一致(44px 产品目标触控高度) */
.nav-menu-btn {
display: none;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 44px;
min-width: 44px;
height: 44px;
padding: 0;
border: 1px solid var(--border-color);
border-radius: 4px;
background: transparent;
color: var(--text-secondary);
cursor: pointer;
transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.nav-menu-btn:hover,
.nav-menu-btn:focus {
border-color: var(--text-muted);
background: transparent;
color: var(--text-primary);
}
.nav-menu-btn .icon {
width: 20px;
height: 20px;
}
/* 窄屏(≤900px):只保留菜单按钮 + 对话框,隐藏图标导航行与旧侧边栏 */
@media (max-width: 900px) {
.nav-menu-btn {
display: inline-flex;
}
/* 窄屏顶栏主题/语言按钮最小 44px 触控面积(产品目标) */
.top-nav .nav-actions .lang-globe-btn,
.top-nav .nav-actions .btn-icon#theme-toggle {
width: 44px;
min-width: 44px;
height: 44px;
min-height: 44px;
}
.nav-links {
display: none;
}
.sidebar-toggle {
display: none;
}
.sidebar {
display: none;
}
}
/* 对话框本体:不在 #site-nav-dialog 上写 display 属性 ——
原生 UA 样式 dialog:not([open]) { display: none } 负责关闭态隐藏,
若这里覆盖 display 会让关闭的对话框重新可见。 */
#site-nav-dialog {
margin: auto;
padding: 0;
width: min(calc(100vw - 32px), 320px);
max-height: min(calc(100dvh - 32px), 640px);
border: none;
border-radius: var(--radius-xl);
background: var(--bg-card);
color: var(--text-primary);
box-shadow: var(--shadow-lg);
overflow-y: auto;
}
#site-nav-dialog::backdrop {
background: rgba(0, 0, 0, 0.55);
}
.site-nav-dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--spacing-sm);
padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
border-bottom: 1px solid var(--border-color);
}
.site-nav-dialog-title {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
}
/* 关闭按钮:≥44px 触控目标(产品目标尺寸,非 WCAG 2.5.8 下限) */
.site-nav-dialog-close {
display: flex;
align-items: center;
justify-content: center;
width: 44px;
min-width: 44px;
height: 44px;
min-height: 44px;
padding: 0;
border: none;
border-radius: var(--radius-md);
background: transparent;
color: var(--text-secondary);
cursor: pointer;
transition: background-color var(--transition-fast), color var(--transition-fast);
}
.site-nav-dialog-close:hover,
.site-nav-dialog-close:focus {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.site-nav-dialog-nav {
padding: var(--spacing-sm);
}
.site-nav-dialog-menu {
list-style: none;
margin: 0;
padding: 0;
}
.site-nav-dialog-item + .site-nav-dialog-item {
margin-top: 2px;
}
/* 导航链接:≥44px 触控目标,主题感知文字/背景 */
.site-nav-dialog-link {
display: flex;
align-items: center;
gap: var(--spacing-sm);
min-height: 44px;
padding: var(--spacing-sm) var(--spacing-md);
border-radius: var(--radius-lg);
color: var(--text-secondary);
font-size: 0.9375rem;
font-weight: 500;
text-decoration: none;
transition: background-color var(--transition-fast), color var(--transition-fast);
}
.site-nav-dialog-link svg {
width: 18px;
height: 18px;
}
.site-nav-dialog-link:hover,
.site-nav-dialog-link:focus {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.site-nav-dialog-link.active,
.site-nav-dialog-link[aria-current="page"] {
background-color: var(--bg-tertiary);
color: var(--text-primary);
font-weight: 600;
}
.site-nav-dialog-link:focus-visible {
outline: 2px solid var(--focus-blue);
outline-offset: 2px;
}
/* ============================================
* 顶栏右侧控件组(A 项:语言切换 + 主题切换统一为一个控件组)
* 作用域限定在 .top-nav 内,避免影响页面其他 .btn / .btn-icon;
* id / class / data-* 全部沿用,无 JS 改动。
* ============================================ */
.top-nav .lang-globe-btn,
.top-nav .btn-icon#theme-toggle {
flex: 0 0 auto;
height: 36px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: transparent;
color: var(--text-secondary);
box-shadow: none;
transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.top-nav .btn-icon#theme-toggle {
width: 36px;
min-width: 36px;
padding: 0;
}
.top-nav .lang-globe-btn:hover,
.top-nav .lang-globe-btn:focus,
.top-nav .btn-icon#theme-toggle:hover,
.top-nav .btn-icon#theme-toggle:focus {
border-color: var(--text-muted);
background: transparent;
box-shadow: none;
}
/* ============================================
* iPhone Safari Specific Optimizations
* iPhone 浏览器特定优化
* ============================================ */
@supports (-webkit-touch-callout: none) {
/* 禁用双击缩放(改善触摸响应速度) */
a, button, .nav-link, .card, .btn, .tab-btn {
touch-action: manipulation;
-webkit-touch-callout: none;
}
/* 移除点击高亮(使用自定义触摸反馈) */
a, button, .nav-link, .card, .btn, .tab-btn, input, select, textarea {
-webkit-tap-highlight-color: transparent;
}
/* 输入框字体至少 16px(防止 iOS 自动缩放页面) */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
textarea,
select {
font-size: 16px !important;
}
/* 安全区适配(刘海屏、底部横条) */
.top-nav {
padding-top: env(safe-area-inset-top, 0px);
padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
}
.main-content {
padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* 底部固定元素安全区 */
.mobile-bottom-bar,
.fixed-bottom {
padding-bottom: env(safe-area-inset-bottom, 0px);
}
}
/* 超小屏手机优化(iPhone SE / mini) */
@media (max-width: 375px) {
html {
font-size: 15px;
}
.top-nav {
padding: 4px 8px;
}
.nav-brand {
font-size: 0.85rem;
}
.nav-link {
padding: 4px 6px;
font-size: 0.75rem;
}
}
/* Note: Component styles have been moved to components.css for better organization */
/* Accessibility Utilities */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: var(--primary-color);
color: var(--text-white);
padding: var(--spacing-sm) var(--spacing-md);
z-index: 10000;
transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; }
/* SVG Icons - Lucide Style */
.icon {
display: inline-block;
width: 1em;
height: 1em;
vertical-align: middle;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
flex-shrink: 0;
}
.icon-spin { animation: icon-spin 1s linear infinite; }
@keyframes icon-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* ============================================
* Modern CSS Features (2026)
* 容器查询、逻辑属性、无障碍增强
* ============================================ */
/* Container Queries - 现代响应式设计 */
@container (min-width: 400px) {
.card-content { padding: var(--spacing-md); }
.modal-meta { grid-template-columns: repeat(2, 1fr); }
}
/* Logical Properties - 更好的国际化支持 */
.modal-close { inset-inline-start: auto; inset-inline-end: var(--spacing-sm); }
/* :has() 选择器 - 父级选择器 */
.card:has(.card-favorite.active) { border-color: var(--accent-red); }
/* Viewport Units - 现代视口单位(仅桌面端生效) */
@media (min-width: 769px) {
.modal { min-height: 100dvh; max-height: 100dvh; }
.modal-content { max-height: calc(100dvh - var(--spacing-md) * 2); }
}
/* Focus Visible - 增强的焦点可见性 */
:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
/* Accent Color - 使用系统主题色 */
:root { color-scheme: light dark; accent-color: var(--primary-color); }
/* Text Balance - 文本平衡 */
.page-title, .modal-header h2 { text-wrap: balance; }
/* ============================================
* 卡片链接样式(P1-2:书籍卡片跳转到详情页)
* ============================================ */
.card-link {
display: block;
color: inherit;
text-decoration: none;
}
a.list-item-image {
display: block;
text-decoration: none;
}
.list-item-title a {
color: inherit;
text-decoration: none;
}
.list-item-title a:hover,
.list-item-title a:focus {
text-decoration: underline;
}
.card-link:hover .card-title,
.card-link:focus .card-title {
text-decoration: underline;
}
.cover-frame a {
display: block;
text-decoration: none;
}
.card-title a {
color: inherit;
text-decoration: none;
/* WCAG 2.5.8:标题链接实测 42.27×21px。
用 inline-block(不是 inline-flex)—— 多行标题仍能正常换行,inline-flex 会把
文字变成单个 flex item 从而不换行。 */
display: inline-block;
min-height: 24px;
}
.card-title a:hover,
.card-title a:focus {
text-decoration: underline;
}
/* Round3 V01 — book-journal typography, neutral theme roles, color-scheme */
:root {
--font-serif: Georgia, 'Times New Roman', 'Songti SC', 'STSong', SimSun, serif;
}
html {
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
html:not([data-theme="light"]) {
color-scheme: dark;
}
}
[data-theme="dark"] {
color-scheme: dark;
}
[data-theme="light"] {
color-scheme: light;
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-serif);
}
/* V03: main content centered at 1400px with 32px gutters (16px mobile). */
.main-content {
width: min(1400px, 100%);
margin: 0 auto;
padding-left: 32px;
padding-right: 32px;
padding-top: calc(var(--top-nav-height) + var(--spacing-md));
transition: none;
}
@media (max-width: 1199px) {
.main-content {
padding-left: 16px;
padding-right: 16px;
}
}
body:has(> .breadcrumbs) .main-content {
padding-top: var(--spacing-md);
}
.top-nav .nav-link, .top-nav .lang-globe-btn, #theme-toggle, .nav-menu-btn, body #clear-search-btn, body #empty-clear-btn {
min-width: 44px;
min-height: 44px;
box-sizing: border-box;
display: inline-flex;
align-items: center;
justify-content: center;
transform: none;
}
.top-nav .btn-icon#theme-toggle{min-width:44px;width:44px;height:44px;min-height:44px}.lang-dropdown .lang-option{min-height:44px;min-width:44px}@media(min-width:901px){.top-nav .nav-menu-btn{display:none}}@media(max-width:900px){.top-nav .nav-menu-btn{display:inline-flex;min-height:44px;min-width:44px}}
/* Round3 computed counterexamples */
#grid-view-featured,
#grid-view-compact {
min-height: 44px;
}
.new-books-page #publisher-filter,
.new-books-page #category-filter,
.new-books-page #days-filter,
.new-books-page #search-input {
min-height: 44px;
}
.report-card-actions .btn {
min-height: 44px;
}
|