diff --git a/index.html b/index.html index b81a57d..47fe03c 100644 --- a/index.html +++ b/index.html @@ -28,8 +28,28 @@ --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 12px -2px rgba(0,0,0,0.04); --header-h: 56px; --sidebar-w: 260px; - --content-max: 960px; + --drawer-bg: #FFFFFF; } + +/* ===== Dark Mode ===== */ +[data-theme="dark"] { + --color-primary: #177DDC; + --color-primary-hover: #4096FF; + --color-primary-active: #0958D9; + --color-primary-bg: rgba(23,125,220,0.15); + --bg: #0A0A0A; + --bg-container: #141414; + --bg-elevated: #1A1A1A; + --border: #303030; + --border-light: #222222; + --text-primary: #E8E8E8; + --text-secondary: #A6A6A6; + --text-tertiary: #6E6E6E; + --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 1px 6px -1px rgba(0,0,0,0.15); + --shadow-md: 0 2px 4px rgba(0,0,0,0.25), 0 4px 12px -2px rgba(0,0,0,0.2); + --drawer-bg: #141414; +} + * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; @@ -38,31 +58,81 @@ body { line-height: 1.57; font-size: 14px; min-height: 100vh; + -webkit-tap-highlight-color: transparent; + transition: background 0.2s ease, color 0.2s ease; } + +/* ===== Header ===== */ .header-bar { position: sticky; top: 0; height: var(--header-h); - background: rgba(255,255,255,0.92); + background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light); - display: flex; align-items: center; padding: 0 24px; z-index: 100; gap: 16px; + display: flex; align-items: center; padding: 0 16px; z-index: 100; gap: 12px; } -.header-bar .brand { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; } +[data-theme="dark"] .header-bar { background: rgba(20,20,20,0.95); } +.header-bar .menu-btn, .header-bar .theme-btn { + display: none; width: 36px; height: 36px; border: none; background: none; + cursor: pointer; border-radius: var(--radius-sm); align-items: center; justify-content: center; + flex-shrink: 0; +} +.header-bar .menu-btn:hover, .header-bar .theme-btn:hover { background: var(--bg-elevated); } +.header-bar .menu-btn svg { width: 20px; height: 20px; color: var(--text-secondary); } +.header-bar .theme-btn { font-size: 16px; } +.header-bar .brand { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; } .header-bar h1 { - font-size: 16px; font-weight: 700; + font-size: 15px; font-weight: 700; background: linear-gradient(135deg, var(--color-primary) 0%, #722ED1 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } -.header-bar .tagline { font-size: 12px; color: var(--text-tertiary); } -.search-box { flex: 1; max-width: 400px; position: relative; } +.header-bar .tagline { font-size: 11px; color: var(--text-tertiary); display: inline; } +.search-box { flex: 1; position: relative; } .search-box input { - width: 100%; padding: 6px 12px 6px 32px; + width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); - font-size: 13px; outline: none; background: var(--bg-elevated); + font-size: 14px; outline: none; background: var(--bg-elevated); + color: var(--text-primary); transition: border-color 0.15s ease, box-shadow 0.15s ease; + min-width: 0; } +.search-box input::placeholder { color: var(--text-tertiary); } .search-box input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-bg); background: var(--bg-container); } -.search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 14px; pointer-events: none; } +.search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 15px; pointer-events: none; line-height: 1; } + +/* ===== Filter Chips (mobile) ===== */ +.chip-bar { + display: none; + padding: 10px 16px 0; + background: var(--bg-container); + border-bottom: 1px solid var(--border-light); + position: sticky; top: var(--header-h); z-index: 90; +} +.chip-bar-inner { + display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; + padding-bottom: 10px; scrollbar-width: none; +} +.chip-bar-inner::-webkit-scrollbar { display: none; } +.chip { + display: inline-flex; align-items: center; gap: 5px; + padding: 7px 14px; border-radius: 20px; + font-size: 13px; font-weight: 500; white-space: nowrap; + border: 1px solid var(--border); background: var(--bg-container); + color: var(--text-secondary); cursor: pointer; + transition: all 0.15s ease; user-select: none; + -webkit-tap-highlight-color: transparent; + min-height: 36px; +} +.chip:active { transform: scale(0.96); } +.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; } +.chip .chip-count { + font-size: 11px; background: rgba(0,0,0,0.08); border-radius: 10px; padding: 0 5px; line-height: 1.5; +} +.chip.active .chip-count { background: rgba(255,255,255,0.25); } + +/* ===== Layout ===== */ .layout { display: flex; max-width: 1200px; margin: 0 auto; min-height: calc(100vh - var(--header-h)); } + +/* ===== Sidebar ===== */ .sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-container); border-right: 1px solid var(--border-light); padding: 16px 0; @@ -75,13 +145,14 @@ body { } .sidebar .nav-item { display: flex; align-items: center; gap: 8px; - padding: 6px 12px; border-radius: var(--radius-sm); + padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all 0.12s ease; text-decoration: none; + min-height: 40px; } .sidebar .nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); } .sidebar .nav-item.active { background: var(--color-primary-bg); color: var(--color-primary); font-weight: 500; } -.sidebar .nav-item .nav-icon { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; } +.sidebar .nav-item .nav-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; } .sidebar .nav-item .nav-count { margin-left: auto; font-size: 11px; color: var(--text-tertiary); background: var(--bg-elevated); border-radius: 10px; padding: 0 6px; line-height: 1.6; @@ -89,45 +160,73 @@ body { .sidebar .nav-item.active .nav-count { background: rgba(22,119,255,0.12); color: var(--color-primary); } .sidebar .sub-nav { padding-left: 24px; overflow: hidden; max-height: 0; transition: max-height 0.25s ease; } .sidebar .sub-nav.open { max-height: 500px; } -.sidebar .sub-nav .nav-item { font-size: 12px; padding: 4px 12px; } +.sidebar .sub-nav .nav-item { font-size: 12px; padding: 5px 12px; } + +/* ===== Drawer Overlay ===== */ +.drawer-overlay { + display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); + z-index: 200; opacity: 0; transition: opacity 0.2s ease; +} +.drawer-overlay.show { display: block; opacity: 1; } +.drawer { + position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw; + background: var(--drawer-bg); z-index: 201; + transform: translateX(-100%); transition: transform 0.25s ease; + overflow-y: auto; +} +.drawer-overlay.show .drawer { transform: translateX(0); } +.drawer-header { + display: flex; align-items: center; justify-content: space-between; + padding: 12px 16px; border-bottom: 1px solid var(--border-light); +} +.drawer-header .close-btn { + width: 32px; height: 32px; border: none; background: var(--bg-elevated); + border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; + justify-content: center; font-size: 18px; color: var(--text-secondary); +} + +/* ===== Main ===== */ .main { flex: 1; padding: 24px 32px 64px; min-width: 0; } .breadcrumb { font-size: 12px; color: var(--text-tertiary); margin-bottom: 12px; } .breadcrumb a { color: var(--text-tertiary); text-decoration: none; } .breadcrumb a:hover { color: var(--color-primary); } .breadcrumb .sep { margin: 0 4px; } -.stats-bar { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; } +.stats-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; } .stat-item { display: flex; align-items: baseline; gap: 4px; - padding: 8px 16px; background: var(--bg-container); + padding: 8px 14px; background: var(--bg-container); border: 1px solid var(--border-light); border-radius: var(--radius-sm); } -.stat-num { font-size: 20px; font-weight: 700; color: var(--color-primary); } +.stat-num { font-size: 18px; font-weight: 700; color: var(--color-primary); } .stat-label { font-size: 12px; color: var(--text-tertiary); } -.wiki-section-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; } -.wiki-section-desc { font-size: 13px; color: var(--text-tertiary); margin-bottom: 16px; } -.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; } +.wiki-section { margin-bottom: 28px; } +.wiki-section-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; } +.wiki-section-desc { font-size: 13px; color: var(--text-tertiary); margin-bottom: 14px; } +.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; } .all-card { background: var(--bg-container); border: 1px solid var(--border-light); - border-radius: var(--radius-md); padding: 16px 20px; + border-radius: var(--radius-md); padding: 16px 18px; transition: all 0.15s ease; text-decoration: none; color: var(--text-primary); display: block; } .all-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); } +.all-card:active { transform: scale(0.99); } .all-card .card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; } .all-card .card-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .all-card .card-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; } -.all-card .card-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 500; } +.all-card .card-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; } .all-card .card-date { font-size: 11px; color: var(--text-tertiary); } .wiki-toc { background: var(--bg-container); border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; margin-top: 8px; } .wiki-toc-header { - display: flex; align-items: center; gap: 10px; padding: 14px 20px; + display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-light); cursor: pointer; user-select: none; transition: background 0.12s ease; + min-height: 44px; } .wiki-toc-header:hover { background: var(--color-primary-bg); } .wiki-toc-header .toc-icon { font-size: 16px; transition: transform 0.2s ease; } @@ -138,33 +237,74 @@ body { .wiki-toc-body.open { max-height: 2000px; } .wiki-toc-item { display: flex; align-items: center; gap: 10px; - padding: 10px 20px 10px 46px; border-bottom: 1px solid var(--border-light); + padding: 12px 18px 12px 42px; border-bottom: 1px solid var(--border-light); transition: background 0.1s ease; text-decoration: none; color: var(--text-primary); + min-height: 48px; } .wiki-toc-item:last-child { border-bottom: none; } -.wiki-toc-item:hover { background: var(--color-primary-bg); } +.wiki-toc-item:active { background: var(--color-primary-bg); } .wiki-toc-item .item-icon { font-size: 14px; color: var(--text-tertiary); flex-shrink: 0; } .wiki-toc-item .item-title { flex: 1; font-size: 13px; } .wiki-toc-item .item-tag { - font-size: 11px; padding: 1px 8px; border-radius: 10px; + font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg-elevated); color: var(--text-tertiary); flex-shrink: 0; } -.footer { - padding: 16px 0; border-top: 1px solid var(--border-light); - font-size: 12px; color: var(--text-tertiary); text-align: center; + +/* ===== Dark mode toggle button (desktop) ===== */ +.theme-toggle { + display: none; + margin-left: auto; + align-items: center; + gap: 8px; + cursor: pointer; } +.theme-toggle button { + width: 36px; height: 36px; border: none; background: none; + cursor: pointer; border-radius: var(--radius-sm); + display: flex; align-items: center; justify-content: center; + font-size: 16px; color: var(--text-secondary); +} +.theme-toggle button:hover { background: var(--bg-elevated); } + +/* ===== Desktop ===== */ +@media (min-width: 769px) { + .chip-bar { display: none !important; } + .theme-toggle { display: flex; } +} + +/* ===== Mobile ===== */ @media (max-width: 768px) { + .header-bar { padding: 0 10px; gap: 8px; } + .menu-btn { display: flex !important; } + .header-bar .tagline { display: none; } + .search-box input { padding: 7px 10px 7px 30px; font-size: 14px; } + .search-box .search-icon { left: 8px; font-size: 14px; } + .chip-bar { display: block; } .sidebar { display: none; } - .main { padding: 16px; } - .header-bar { padding: 0 12px; } - .search-box { max-width: 200px; } - .all-grid { grid-template-columns: 1fr; } + .main { padding: 16px 12px 48px; } + .all-grid { grid-template-columns: 1fr; gap: 10px; } + .all-card { padding: 14px 16px; } + .stats-bar { gap: 8px; } + .stat-item { padding: 6px 10px; } + .stat-num { font-size: 16px; } + .wiki-section-title { font-size: 16px; } + .wiki-toc-item { padding: 10px 14px 10px 36px; } + .wiki-toc-header { padding: 12px 14px; } + + /* Theme toggle in mobile header */ + .theme-toggle { display: flex !important; margin-left: 0; } + .theme-toggle button { + width: 32px; height: 32px; font-size: 15px; + } }
+

Wiki 知识库

一人公司开发团队 @@ -173,18 +313,60 @@ body { 🔍
+
+ +
+ +
+
+
+ + +
+
+
+ 导航 + +
+
+
+
+