/* ============================================================ 家书 FamilyBook · 界面样式 配色取自图标:宣纸米 / 砖红封面 / 深褐书脊 / 纸白 原则:扁平、留白充足、字重克制(正文 400,标题 500-600) ============================================================ */ :root { --paper: #F7F3EA; --surface: #FFFFFF; --ink: #2C231D; --muted: #7E6B5A; --faint: #A8988A; --brand: #A84A28; --brand-2: #C96F45; --brand-ink:#6E3820; --green: #6F9E5C; --red: #C0533F; --line: rgba(44, 35, 29, .10); --line-2: rgba(44, 35, 29, .06); --radius: 16px; --radius-s: 10px; --shadow: 0 1px 2px rgba(44, 35, 29, .05); --shadow-l: 0 4px 16px rgba(44, 35, 29, .08); /* ---- 动作按钮的统一度量 ---- 用户提过三次「设置按钮和记一场电影按钮高度要一致」。为杜绝再犯, 这里把按钮高度拆成 4 个变量,并算出唯一的高度: --act-h = 上下内边距 + 行高 + 上下边框 = 9*2 + 14*1.7 + 1*2 = 43.8px 文字按钮靠 padding + line-height 自然撑到这个高度; **只有图标的方形按钮**(.btn-icon)显式写高度,但取的是同一个 --act-h, 这样两边永远相等,改一处就同步。 */ --act-pad-y: 9px; --act-pad-x: 16px; --act-font: 14px; --act-line: 1.7; --act-h: calc(var(--act-pad-y) * 2 + var(--act-font) * var(--act-line) + 1px * 2); } * { box-sizing: border-box; } html, body { height: 100%; } body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif; -webkit-font-smoothing: antialiased; } a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; } /* ---------------- 顶栏 ---------------- */ .topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); } .topbar-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; } .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); } .brand:hover { text-decoration: none; } .brand img { width: 30px; height: 30px; border-radius: 8px; display: block; } .brand span { font-size: 16px; font-weight: 600; letter-spacing: .5px; } .nav { display: flex; gap: 4px; margin-left: 8px; } .nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; } .nav a:hover { background: var(--line-2); text-decoration: none; } .nav a.on { background: var(--brand); color: #fff; } .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; } .who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; } /* 姓名 + 头像是个下拉菜单的「把手」——hover 时给点反馈,让人知道它可点 */ .who-menu { position: relative; } .who-menu > summary { list-style: none; cursor: pointer; padding: 4px 6px; border-radius: 999px; } .who-menu > summary::-webkit-details-marker { display: none; } .who-menu > summary:hover { background: var(--line-2); } .who-menu > summary:hover .who-name { color: var(--brand); } .who-menu[open] > summary { background: var(--line-2); } .who-menu[open] > summary .caret { transform: rotate(180deg); } .who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; } .who img { transition: box-shadow .15s ease; } .who-menu > summary:hover img { box-shadow: 0 0 0 2px var(--brand-2); } /* 那个小三角:没有它,用户不知道"名字能点开" */ .caret { width: 0; height: 0; margin-left: -2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--faint); transition: transform .15s ease; } .menu-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 148px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow-l); display: flex; flex-direction: column; } .menu-list a { padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; white-space: nowrap; } .menu-list a:hover { background: var(--line-2); text-decoration: none; color: var(--brand); } /* 退出放在最下面并隔一条线:它是"离开",和上面几个"改点什么"不是一类动作 */ .menu-list .menu-exit { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--line-2); border-radius: 0 0 8px 8px; color: var(--muted); } .menu-list .menu-exit:hover { color: var(--brand); } /* ---- 观影页的「设置」下拉:图标按钮 + 永远贴右 ---- 用户明确要求(2026-10-01): · 去掉「设置」二字,只留**三条横线**图标(☰); · 在**所有页面都排在最右侧**(位置统一); · 点开后的每条条目,**文字前都要有图标**; · 除设置外,其它按钮都要**有颜色**,跟设置区分开。 贴右的做法:`margin-left:auto` 把它推到动作区最右端 —— 这样无论各页把片段 require 在 actions 的哪个位置(有的写在最前、有的写在最后),它都贴右, 不必逐页调顺序,也就不会有"某个页面漏了"的情况。 */ .movie-set { position: relative; margin-left: auto; } .movie-set > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; } .movie-set > summary::-webkit-details-marker { display: none; } .movie-set[open] > summary { border-color: var(--brand); color: var(--brand); } /* 方形图标按钮:只有图标、无文字。高度**必须**取 --act-h, 与「记一场电影」等实心按钮同高(那个高度由 --act-pad-y/--act-font/--act-line 推出)。 ⚠️ 别在这里另写一个数字(曾写死 40px,比文字按钮的 43.8px 矮了 3.8px,被用户连续投诉)。 */ .btn-icon { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 0 !important; width: var(--act-h); height: var(--act-h); min-width: var(--act-h); display: inline-flex; align-items: center; justify-content: center; line-height: 1; } .btn-icon:hover { background: #FAF7F1; color: var(--brand); border-color: var(--brand); } .btn-icon svg { display: block; } /* 观影设置菜单:从右上角改成**按钮下方右对齐**(按钮贴右,菜单也贴右才不会跑出屏外) */ .movie-set .menu-list { left: auto; right: 0; top: calc(100% + 8px); } .movie-set .menu-list a { display: flex; align-items: center; gap: 10px; } .movie-set .menu-list a .mi { flex: 0 0 16px; color: var(--muted); } .movie-set .menu-list a:hover .mi, .movie-set .menu-list a.on .mi { color: currentColor; } .movie-set .menu-list a.on { color: var(--brand); background: var(--line-2); } .link-quiet { color: var(--muted); font-size: 14px; } .link-quiet:hover { color: var(--brand); } /* 顶栏里的文字一律不许换行 —— 一换行就是「首/页」「名/册」竖排,很难看 */ .nav a, .topbar-right a, .who-name { white-space: nowrap; } /* ---------------- 布局 ---------------- */ .container { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; } .container-narrow { max-width: 560px; margin: 0 auto; padding: 28px 24px 64px; } .page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; } .page-head h1 { font-size: 22px; font-weight: 600; margin: 0; } .page-head .sub { color: var(--muted); font-size: 14px; } .page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; } /* ---- 页头动作区的完整规格见**文件靠后**的「页头动作区」一节 ---- 刻意放后面:.btn / .btn-ghost / .btn-icon 等基类定义在文件中部, CSS 同特异性「后写的赢」——放这里会被它们覆盖(踩过:设置按钮被染成品牌底、 btn-ghost 仍是白的)。此处只留布局,样式集中在后面一处,便于对照。 */ .section { margin-top: 28px; } .section-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin: 0 0 12px; } .section-title .hint { font-weight: 400; color: var(--muted); font-size: 13px; } /* ---------------- 卡片 ---------------- */ .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); } .card-pad { padding: 20px; } /* 首页头图 */ .hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; } .hero-logo { width: 64px; height: 64px; border-radius: 16px; flex: 0 0 auto; } .hero-main { flex: 1 1 240px; min-width: 0; } .hero h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; } .hero .motto { color: var(--muted); margin: 0; font-size: 14px; } /* 那句小字到底是谁的:自己写的那句要标一下,否则用户会以为这是系统统一发的 */ .motto-from { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--line-2); font-size: 11px; color: var(--faint); } .motto-edit { margin-left: 8px; font-size: 12px; color: var(--brand-2); white-space: nowrap; } /* 详情页顶部引用本人的一句话 */ .motto-line { margin: -8px 0 16px; padding-left: 12px; border-left: 3px solid var(--brand-2); color: var(--muted); font-size: 14px; } .hero-stats { margin-left: auto; display: flex; gap: 28px; } .stat { text-align: center; } .stat b { display: block; font-size: 24px; font-weight: 600; line-height: 1.2; } .stat span { font-size: 12px; color: var(--muted); } /* ---------------- 成员卡 ---------------- */ .people-grid { display: grid; gap: 16px; margin-top: 4px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); } .person { display: block; color: var(--ink); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; } .person:hover { transform: translateY(-2px); box-shadow: var(--shadow-l); text-decoration: none; } .person .ph { background: #F1E7D6; aspect-ratio: 1 / 1; overflow: hidden; } .person .ph img { width: 100%; height: 100%; object-fit: cover; display: block; } .person .pb { padding: 12px 14px 14px; } .person .pname { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; } .person .pmeta { color: var(--muted); font-size: 13px; margin-top: 2px; } .badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 1.7; background: var(--line-2); color: var(--muted); } .badge-admin { background: #F6E3D7; color: var(--brand-ink); } .badge-open { background: #E6F0DC; color: #4A7226; } .badge-me { background: var(--brand); color: #fff; } /* 生日条 —— 一个人可能同时出两条(农历与阳历不在同一天), 落在同一天时并成一条、kinds 里挂多个标签,正好对应"要分别提醒"。 */ .bdays { display: flex; gap: 12px; flex-wrap: wrap; } .bday { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px 10px 10px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; } .bday:hover { transform: translateY(-2px); box-shadow: var(--shadow-l); text-decoration: none; } .bday img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; } .bday b { font-weight: 500; } .bday .d { color: var(--brand); font-size: 13px; } .bday-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; } .bday-date { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; } /* 「身份证生日 / 阳历生日 / 农历生日」的标签,首页与详情页共用 */ .bd-kind { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 1.8; background: var(--line-2); color: var(--muted); } .bd-kind-id { background: #E6F0DC; color: #4A7226; } .bd-kind-solar { background: #F6E3D7; color: var(--brand-ink); } .bd-kind-lunar { background: #E8E4F2; color: #55477E; } /* 详情页的三个生日 */ .bd-list { list-style: none; margin: 0; padding: 0; } .bd-list li { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; } .bd-list .bd-val { font-variant-numeric: tabular-nums; } /* ---------------- 表单 ---------------- */ .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } /* ⚠️ min-width:0 是必需的(v11 实测踩到):.field 是 grid 项,默认 min-width:auto 会被内部 的 min-width:auto 约 150px(带日历图标 + 占位数字)—— 两个日期框 + 「至」在 360px 下会横向溢出(实测 scrollW 390 > clientW 360)。 给 0 并让它们等比收缩;这是继 .field(select)之后同一页的第二个溢出源。 */ .date-range .input { flex: 1 1 0; min-width: 0; } .results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 12px; } .results-head h3 { margin: 0; font-size: 17px; } .results-head .sub { color: var(--muted); font-size: 13px; } /* ---- 年度报告 ---- */ .year-pick { display: inline-block; } .report-grid { display: grid; gap: 14px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } .report-grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .report-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); } .report-card .n { font-size: 32px; font-weight: 700; color: var(--brand); line-height: 1.15; font-variant-numeric: tabular-nums; } .report-card .l { font-size: 13px; color: var(--muted); } .report-card .v { font-size: 19px; font-weight: 600; margin-top: 2px; } .report-card .s { font-size: 12px; color: var(--faint); margin-top: 4px; } /* 月份竖柱图(纯 CSS) */ .vgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 160px; margin-top: 4px; } .vcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; } .vcol .vbar { width: 68%; min-height: 2px; background: linear-gradient(var(--brand-2), var(--brand)); border-radius: 5px 5px 2px 2px; transition: height .4s ease; } .vcol .vlab { font-size: 11px; color: var(--muted); } .vcol .vnum { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; } .kw-cloud { display: flex; flex-wrap: wrap; gap: 8px; } .kw-cloud .kw { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--line-2); color: var(--brand-ink); border: 1px solid var(--line); }