/* ============================================================================
 * ui.css —— 账号 / 方案 / 后台 的通用组件样式
 * ----------------------------------------------------------------------------
 * 被全部页面共用（含首页 index.html，它用的是另一套 css/style.css）。
 * 因此这里只放「新增组件」的样式，不得出现会覆盖站点原有外观的全局规则。
 * 注意：css.css 里有一条 `div{max-width:500px;margin:0 auto}`，
 *       列表容器必须显式放开 max-width，否则卡片会比外层窄一圈。
 * ========================================================================== */

/* ---------- 顶栏 ----------
   与站点原有配色对齐：底 #1b1b1b（比页面底 #222 略深一档）、
   导航项用 #303030 全圆胶囊（和首页 .home a 同一语汇）、
   文字用 rgba(255,255,255,.5)（和 .top h3/h4 同一档灰）。
   刻意不用半透明 + 毛玻璃 —— 那是另一种视觉语言，和原来的扁平厚圆风格打架。 */
body.has-appbar{ padding-top: 52px; }

.app-bar{
	position: fixed; top: 0; left: 0; right: 0; z-index: 900;
	display: flex; align-items: center; gap: 8px;
	width: 100%; max-width: 100%; margin: 0; padding: 0 12px;
	height: 52px; box-sizing: border-box; text-align: left;
	background: #1b1b1b;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}
/* 顶栏不放应用名 / 首页链接（用户要求去掉），最左就是第一个功能入口。
   导航整体左对齐、右侧留给登录态，中间留白由 .app-bar-nav 的 flex:1 吃掉。 */
.app-bar-nav{ display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; text-align: left; scrollbar-width: none; }
.app-bar-nav::-webkit-scrollbar{ display: none; }
/* margin/background/display 必须显式声明：首页 css/style.css 里的 `nav a` 会渗进来
   （它带背景色和 % 外边距），只靠字体颜色覆盖不住。 */
.app-bar-nav a{
	display: inline-block; margin: 0; background: transparent;
	color: rgba(255, 255, 255, .5); font-size: 13px; line-height: 1.6;
	padding: 6px 9px; border-radius: 999px; white-space: nowrap;
}
.app-bar-nav a:hover{ color: #fff; background: #303030; }
.app-bar-nav a.is-on{ color: #00d180; background: #303030; font-weight: 600; }
.app-bar-nav a.is-hidden{ display: none; }
.app-bar-user{ display: flex; align-items: center; gap: 8px; flex: 0 0 auto; font-size: 13px; color: rgba(255, 255, 255, .5); }
.app-bar-name{ max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.app-bar-login{ color: #0c1a14; background: #00d180; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.app-bar-login:hover{ background: #00e88d; color: #0c1a14; }
.app-bar-out{ color: rgba(255, 255, 255, .6); background: #303030; border: 0; border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.app-bar-out:hover{ color: #fff; background: #3a3a3a; }

/* ---------- 轻提示 ---------- */
.ui-toasts{
	position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
	z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: center;
	max-width: 92%; pointer-events: none;
}
.ui-toast{
	background: #303030; color: #fff; border: 1px solid #3d3d3d; border-radius: 999px;
	padding: 9px 18px; font-size: 13px; line-height: 1.5;
	opacity: 0; transform: translateY(8px);
	transition: opacity .22s ease, transform .22s ease;
}
.ui-toast.is-in{ opacity: 1; transform: translateY(0); }
.ui-toast.is-ok{ border-color: #0d5c3f; background: #12352a; color: #7ff0bd; }
.ui-toast.is-warn{ border-color: #6a5520; background: #3a3016; color: #ffd98a; }
.ui-toast.is-err{ border-color: #6d2733; background: #3a1720; color: #ff909c; }

/* ---------- 弹窗 ---------- */
.ui-mask{
	position: fixed; top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0, 0, 0, .66); z-index: 1200;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	max-width: 100%;
}
.ui-dialog{
	width: 100%; max-width: 380px; background: #2b2b2b; border: 1px solid #3d3d3d;
	border-radius: 16px; padding: 18px; box-sizing: border-box; text-align: left;
}
.ui-dialog-msg{ color: #e6e6e6; font-size: 14px; line-height: 1.7; margin: 0 0 12px; text-align: left; }
.ui-dialog-input{
	width: 100%; box-sizing: border-box; background: #1e1e1e; border: 1px solid #3d3d3d;
	border-radius: 10px; color: #8fd6ff; font-size: 13px; padding: 10px; margin-bottom: 14px;
	font-family: inherit;
}
.ui-dialog-act{ display: flex; gap: 10px; justify-content: flex-end; }
.ui-btn{
	border: 0; border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer;
	font-family: inherit; background: #00d180; color: #0c1a14; font-weight: 700;
}
.ui-btn.ghost{ background: #3a3a3a; color: #cfcfcf; font-weight: 400; }
.ui-btn:hover{ filter: brightness(1.08); }

/* ---------- 核算页：产品图 + 操作区 ---------- */
.prod-shot{ width: 80%; max-width: 80%; margin: 0 auto 14px auto; }
.prod-shot img{ width: 100%; display: block; border-radius: 14px; border: 1px solid #3a3a3a; }
.prod-upload{
	flex: 1 1 120px; border-radius: 999px; padding: 12px 10px; font-size: 15px;
	cursor: pointer; font-family: inherit; background: #303030; color: #fff;
	border: 1px dashed #4a4a4a; text-align: center; box-sizing: border-box;
	display: flex; align-items: center; justify-content: center;
}
.prod-upload:hover{ background: #3a3a3a; border-color: #6a6a6a; }
.prod-upload input{ display: none; }
.prod-upload.is-set{ border-style: solid; border-color: #00acd1; color: #7fd4ee; }
.action-row{ display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 92%; max-width: 92%; margin: 18px auto 0 auto; }
.pill-btn{
	flex: 1 1 120px; border-radius: 999px; padding: 12px 10px; font-size: 15px;
	cursor: pointer; font-family: inherit; background: #303030; color: #fff;
	border: 1px solid #3d3d3d; text-align: center;
}
.pill-btn:hover{ background: #3a3a3a; }
.pill-btn.primary{ background: #00d180; color: #0c1a14; font-weight: 700; border-color: #00d180; }
.pill-btn.accent{ background: #00acd1; color: #04222b; font-weight: 700; border-color: #00acd1; }
.pill-btn.primary:hover{ background: #00e88d; }
.pill-btn.accent:hover{ background: #12bfe4; }
.pill-btn:disabled{ opacity: .55; cursor: default; }
.plan-meta{ display: block; font-size: 12px; color: #7f8792; text-align: center; margin-top: 12px; line-height: 1.9; }
.plan-meta a{ color: #00acd1; }
.plan-meta a:hover{ color: #12bfe4; }

/* ---------- 登录 / 账号 ---------- */
.auth-wrap{ width: 92%; max-width: 420px; margin: 30px auto 60px auto; text-align: left; }
.auth-card{ background: #2b2b2b; border: 1px solid #3a3a3a; border-radius: 18px; padding: 22px 18px; }
.auth-card h1{ font-size: 20px; color: #fff; margin-bottom: 6px; }
.auth-sub{ color: #8b939e; font-size: 13px; line-height: 1.7; margin-bottom: 18px; }
.field{ margin-bottom: 14px; }
.field label{ display: block; font-size: 13px; color: #9aa2ad; margin-bottom: 6px; }
.field input{
	width: 100%; box-sizing: border-box; background: #1e1e1e; border: 1px solid #3a3a3a;
	border-radius: 12px; color: #fff; font-size: 16px; padding: 11px 12px; font-family: inherit;
}
.field input:focus{ border-color: #00d180; }
.auth-msg{ min-height: 20px; font-size: 13px; line-height: 1.6; margin: 2px 0 10px; text-align: left; }
.auth-msg.err{ color: #ff909c; }
.auth-msg.ok{ color: #7ff0bd; }
.auth-submit{ width: 100%; border-radius: 12px; padding: 13px; font-size: 16px; }
.switch-line{ text-align: center; font-size: 13px; color: #8b939e; margin-top: 16px; }
.switch-line a{ color: #00acd1; }

/* ---------- 列表页 / 后台 ---------- */
.page-wrap{ width: 94%; max-width: 560px; margin: 18px auto 70px auto; text-align: left; }
.page-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1{ font-size: 19px; color: #fff; }
.page-head .sub{ font-size: 12px; color: #7f8792; }
.toolbar{ display: flex; gap: 8px; margin-bottom: 14px; }
.toolbar input{
	flex: 1; background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 10px;
	color: #fff; padding: 10px 12px; font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.toolbar input:focus{ border-color: #00d180; }
.card{
	display: flex; gap: 12px; background: #2b2b2b; border: 1px solid #383838;
	border-radius: 14px; padding: 12px; margin-bottom: 10px; text-align: left;
}
.card .thumb{
	width: 76px; height: 76px; flex: 0 0 76px; border-radius: 10px; background: #1e1e1e;
	overflow: hidden; display: flex; align-items: center; justify-content: center;
	color: #4a4a4a; font-size: 11px;
}
.card .thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body{ flex: 1; min-width: 0; }
.card .t{ color: #fff; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .m{ color: #7f8792; font-size: 12px; margin-top: 4px; line-height: 1.7; }
.card .acts{ display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.mini{
	border: 1px solid #3d3d3d; background: #333; color: #cfcfcf; font-size: 12px;
	padding: 5px 10px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.mini:hover{ color: #fff; background: #3d3d3d; }
.mini.danger{ color: #ff909c; border-color: #5a2a33; }
.mini.on{ color: #0c1a14; background: #00d180; border-color: #00d180; font-weight: 700; }
.empty{ text-align: center; color: #6f7681; font-size: 14px; padding: 44px 12px; line-height: 1.9; }
.badge{ display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #333; color: #9aa2ad; margin-left: 6px; vertical-align: middle; }
.badge.ok{ background: #12352a; color: #7ff0bd; }
.badge.blue{ background: #0e2a33; color: #7fd4ee; }
.pager{ display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; font-size: 13px; color: #8b939e; }
.stats{ display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat{
	flex: 1 1 calc(50% - 6px); background: #2b2b2b; border: 1px solid #383838; border-radius: 12px;
	padding: 12px; text-align: center; box-sizing: border-box;
}
.stat b{ display: block; font-size: 22px; color: #00d180; font-weight: 700; line-height: 1.5; }
.stat span{ font-size: 12px; color: #7f8792; }

/* ---------- 分享查看页 ---------- */
.share-banner{
	width: 88%; max-width: 88%; margin: 0 auto 16px auto; padding: 12px 14px;
	background: #16281f; border: 1px solid #1d6b4a; border-radius: 14px;
	color: #7ff0bd; font-size: 13px; line-height: 1.8; text-align: left;
}
.share-banner a{ color: #7ff0bd; text-decoration: underline; }
.share-foot{ display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; width: 92%; max-width: 92%; margin: 20px auto 0 auto; }

/* ---------- 抵消 css.css 的 `div{max-width:500px}`（列表/卡片需跟随外层宽度） -------- */
.page-wrap, .page-wrap *{ max-width: 100%; }
.auth-wrap, .auth-wrap *{ max-width: 100%; }
#mine-list, #ad-list{ max-width: 100%; }
.card{ max-width: 100%; }
.stats, .toolbar, .pager, .empty{ max-width: 100%; }
.share-banner, .share-foot{ max-width: 88%; }
.ui-toasts, .ui-mask{ max-width: 100%; }

/* ---------- 抵消 css.css 的 `div{text-align:center}`（会命中所有新加的 div） -------- */
.page-wrap, .page-head, .toolbar, .card, .card .t, .card .m, .card .acts,
.card .body, .field, .field label, .auth-card, .auth-wrap, .share-banner{ text-align: left; }
.ui-toast, .empty, .stat, .pager{ text-align: center; }

/* ---------- 顶栏：滚动提示 ----------
   登录态带用户名时导航可能放不下，此时让它横向滚动，并在右侧加一道渐隐，
   这样最后一个被裁掉的项看起来是「还能往右滑」，而不是像坏了。 */
.app-bar-nav.is-scroll{
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
}

@media (max-width: 420px){
	.app-bar{ gap: 6px; padding: 0 8px; }
	.app-bar-name{ max-width: 62px; }
	/* 去掉应用名后导航只剩三项，空间宽松了；这里保留一档收紧，
	   是为「登录后多出用户名 + 退出按钮」这种最挤的状态兜底 */
	.app-bar-nav a{ font-size: 12.5px; padding: 6px 6px; }
	.app-bar-login{ font-size: 12.5px; padding: 6px 10px; }
	#p, .prod-upload{ font-size: 15px; }
	ul li h2{ width: 82px; font-size: 16px; }
	ul li h2.wide-h2{ width: 118px; }
}

