/*
Theme Name: iOS OTA Store
Theme URI: https://example.com/
Description: 面向大众的 iOS 5+ 在线安装应用商店模板，内置前端用户系统（登录/注册/我的应用）、分类、搜索、评分评论。CSS 完全兼容 iOS 5 Safari（无 flexbox、全 -webkit- 前缀、px 单位）。
Author: WorkBuddy
Version: 2.0
License: GPLv2
*/

/* ========== 基础重置（iOS5 安全） ========== */
html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
* { margin: 0; padding: 0; -webkit-box-sizing: border-box; box-sizing: border-box; }
body {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	background: #eef1f4; color: #1c2530;
	font-size: 16px; line-height: 1.5;
	-webkit-tap-highlight-color: rgba(0,0,0,0.1);
	padding-top: 58px;
	padding-bottom: 62px;
}
img { border: 0; max-width: 100%; vertical-align: middle; }
a { color: #0a6dd0; text-decoration: none; }

/* ========== 顶栏（fixed 置顶，body 顶部留白 58px 补偿） ========== */
.site-header {
	position: fixed; left: 0; right: 0; top: 0; z-index: 99;
	background: #24303e;
	background: -webkit-linear-gradient(top, #3a4a5c 0%, #24303e 100%);
	background: linear-gradient(to bottom, #3a4a5c 0%, #24303e 100%);
	border-bottom: 1px solid #10161d;
	padding: 12px 16px 0 16px;
	overflow: hidden;
}
.site-title {
	font-size: 20px; font-weight: bold; color: #ffffff;
	float: left; text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
}
/* 顶栏返回按钮（非首页显示） */
.header-back {
	float: left; color: #ffffff; font-size: 40px; line-height: 30px;
	font-weight: bold; padding: 0 16px 0 2px; margin-left: -8px;
}
.header-back:active { color: #4da3f2; }
.user-links { float: right; padding-top: 3px; font-size: 13px; }
.user-links a { color: #cfe0f2; margin-left: 10px; }
.user-links a b { color: #ffffff; }

/* 顶栏搜索放大镜（纯 CSS 画，无 emoji/无图片） */
.icon-search {
	display: inline-block; width: 13px; height: 13px;
	border: 2px solid #cfe0f2;
	-webkit-border-radius: 50%; border-radius: 50%;
	position: relative; top: 1px;
}
.icon-search:after {
	content: "";
	position: absolute; right: -7px; bottom: -3px;
	width: 8px; height: 2px; background: #cfe0f2;
	-webkit-border-radius: 1px; border-radius: 1px;
	-webkit-transform: rotate(45deg); transform: rotate(45deg);
}

/* 搜索框 */
.search-form { clear: both; margin: 10px 0 0 0; padding-bottom: 12px; overflow: hidden; }
.search-form input[type=text] {
	float: left; width: 70%; height: 34px;
	border: 1px solid #17202a; -webkit-border-radius: 6px 0 0 6px; border-radius: 6px 0 0 6px;
	padding: 0 10px; font-size: 14px;
	-webkit-appearance: none; background: #ffffff; color: #1c2530;
}
.search-form button {
	float: left; width: 30%; height: 34px; border: 1px solid #17202a;
	border-left: 0; -webkit-border-radius: 0 6px 6px 0; border-radius: 0 6px 6px 0;
	background: #0a6dd0;
	background: -webkit-linear-gradient(top, #3d92e6 0%, #0a6dd0 100%);
	background: linear-gradient(to bottom, #3d92e6 0%, #0a6dd0 100%);
	color: #ffffff; font-size: 14px; font-weight: bold;
	-webkit-appearance: none; text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

/* 顶部分类导航 */
.top-nav { clear: both; background: #1c2530; overflow: hidden; }
.top-nav a {
	display: block; float: left; padding: 9px 13px;
	color: #9fb2c6; font-size: 13px; border-right: 1px solid #141b23;
}
.top-nav a.cur { color: #ffffff; background: #0a6dd0; }

/* ========== 页面容器 ========== */
.page-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 14px 12px 40px 12px; }

/* ========== 提示条 ========== */
.device-tip {
	border: 1px solid #d9c36a; background: #fdf6d8; color: #6b5a1e;
	padding: 8px 10px; -webkit-border-radius: 6px; border-radius: 6px;
	font-size: 13px; margin-bottom: 14px;
}
.device-tip.ok { border-color: #a8cfa0; background: #e8f6e4; color: #2f6b2a; }

/* ========== 应用卡片 ========== */
.app-card {
	position: relative;
	background: #ffffff; border: 1px solid #ccd4dc;
	-webkit-border-radius: 10px; border-radius: 10px;
	padding: 14px; margin-bottom: 14px; overflow: hidden;
	-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.08); box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
/* 列表卡片：获取按钮与图标垂直居中对齐（图标 57px + 卡片 padding 14px，中心 ≈43px） */
.app-card .btn-get {
	position: absolute; right: 14px; top: 25px;
	margin: 0; float: none;
}
.app-icon {
	float: left; width: 57px; height: 57px;
	-webkit-border-radius: 10px; border-radius: 10px;
	border: 1px solid #b9c2cb; margin-right: 12px; background: #dfe5ea;
}
.app-info { margin-left: 69px; margin-right: 82px; min-height: 57px; }
.app-name {
	font-size: 17px; font-weight: bold; color: #10161d;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.app-meta { font-size: 12px; color: #7c8894; margin-top: 2px; }
.app-desc {
	clear: both; font-size: 14px; color: #3c4753;
	margin-top: 10px; padding-top: 10px; border-top: 1px solid #e4e9ee;
	word-break: break-word;
}

/* 星级 */
.stars .star { color: #c9d1d9; font-size: 14px; }
.stars .star.on { color: #f5a623; }
.rating-num { color: #7c8894; font-size: 12px; }

/* ========== 分类标签 ========== */
.cat-chips { margin-bottom: 14px; overflow: hidden; }
.cat-chips a {
	display: block; float: left; margin: 0 8px 8px 0;
	padding: 6px 14px; font-size: 13px; color: #3c4753;
	background: #ffffff; border: 1px solid #ccd4dc;
	-webkit-border-radius: 15px; border-radius: 15px;
}
.cat-chips a.cur { background: #0a6dd0; border-color: #0857a6; color: #ffffff; }

/* ========== 卡片右侧「获取」按钮 ========== */
.btn-get {
	float: right;
	width: 70px; text-align: center;
	padding: 7px 0; margin: 6px 0 0 10px;
	font-size: 14px; font-weight: bold; color: #ffffff;
	text-shadow: 0 -1px 0 rgba(0,0,0,0.35);
	background: #3fa233;
	background: -webkit-linear-gradient(top, #6cc25c 0%, #3fa233 50%, #2f8a26 51%, #3fa233 100%);
	background: linear-gradient(to bottom, #6cc25c 0%, #3fa233 50%, #2f8a26 51%, #3fa233 100%);
	border: 1px solid #2c7a22;
	-webkit-border-radius: 7px; border-radius: 7px;
	-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-get:active {
	background: #2f8a26;
	background: -webkit-linear-gradient(top, #2f8a26 0%, #3fa233 100%);
	background: linear-gradient(to bottom, #2f8a26 0%, #3fa233 100%);
}
.btn-get.disabled {
	background: #a9b4bf;
	background: -webkit-linear-gradient(top, #c2cad2 0%, #a9b4bf 100%);
	background: linear-gradient(to bottom, #c2cad2 0%, #a9b4bf 100%);
	border-color: #8d99a5; color: #eef1f4;
	-webkit-box-shadow: none; box-shadow: none;
}

/* ========== 安装按钮 ========== */
.btn-install {
	display: block; text-align: center; margin-top: 12px; padding: 11px 10px;
	font-size: 16px; font-weight: bold; color: #ffffff;
	text-shadow: 0 -1px 0 rgba(0,0,0,0.35);
	background: #3fa233;
	background: -webkit-linear-gradient(top, #6cc25c 0%, #3fa233 50%, #2f8a26 51%, #3fa233 100%);
	background: linear-gradient(to bottom, #6cc25c 0%, #3fa233 50%, #2f8a26 51%, #3fa233 100%);
	border: 1px solid #2c7a22;
	-webkit-border-radius: 8px; border-radius: 8px;
	-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-install:active {
	background: #2f8a26;
	background: -webkit-linear-gradient(top, #2f8a26 0%, #3fa233 100%);
	background: linear-gradient(to bottom, #2f8a26 0%, #3fa233 100%);
}
.btn-install.disabled {
	background: #a9b4bf;
	background: -webkit-linear-gradient(top, #c2cad2 0%, #a9b4bf 100%);
	background: linear-gradient(to bottom, #c2cad2 0%, #a9b4bf 100%);
	border-color: #8d99a5; color: #eef1f4; -webkit-box-shadow: none; box-shadow: none;
}

/* 返回按钮（详情页） */
.btn-back {
	display: inline-block; margin-bottom: 10px; padding: 5px 12px;
	font-size: 13px; color: #0a6dd0;
	background: #ffffff; border: 1px solid #ccd4dc;
	-webkit-border-radius: 6px; border-radius: 6px;
}
.btn-back:active { background: #e4e9ee; }

/* ========== 详情页 ========== */
.app-hero { padding: 6px 0 2px 0; }
.app-hero .app-name { font-size: 20px; }
.app-hero .app-icon { width: 64px; height: 64px; }
.app-hero .app-info { margin-left: 76px; margin-right: 82px; min-height: 64px; }
/* 标题旁版本号 */
.ver-tag { font-size: 13px; font-weight: normal; color: #7c8894; }
.install-hint { text-align: center; font-size: 12px; color: #7c8894; margin-top: 8px; }

.app-section {
	background: #ffffff; border: 1px solid #ccd4dc;
	-webkit-border-radius: 10px; border-radius: 10px;
	padding: 14px; margin-top: 14px;
}
.app-section h2 {
	font-size: 15px; color: #5b6875; text-transform: uppercase;
	margin-bottom: 8px; border-bottom: 1px solid #e4e9ee; padding-bottom: 6px;
}
.app-section p { font-size: 14px; color: #3c4753; }

/* 截图横滑（老式横向排布 + overflow，iOS5 不支持 scroll-snap） */
.screens { overflow-x: auto; white-space: nowrap; padding-bottom: 6px; }
.screens img {
	display: inline-block; width: 150px; margin-right: 8px;
	border: 1px solid #ccd4dc; -webkit-border-radius: 6px; border-radius: 6px;
}

/* 版本记录 / 历史版本 */
.version-item { padding: 8px 0; border-bottom: 1px solid #eef1f4; font-size: 14px; }
.version-item:last-child { border-bottom: 0; }
.version-item .ver-num { font-weight: bold; color: #10161d; }
.version-item .ver-date { float: right; color: #9aa5b1; font-size: 12px; }
.ver-item { padding: 9px 0; border-bottom: 1px solid #eef1f4; font-size: 14px; overflow: hidden; }
.ver-item:last-child { border-bottom: 0; }
.ver-item .ver-num { font-weight: bold; color: #0a6dd0; }
.ver-item .ver-date { color: #9aa5b1; font-size: 12px; margin-left: 8px; }
.ver-item .btn-get { float: right; margin: 0; }

/* 评论 / 评分 */
.review-item { padding: 10px 0; border-bottom: 1px solid #eef1f4; }
.review-item:last-child { border-bottom: 0; }
.review-head { overflow: hidden; }
.review-author { float: left; font-weight: bold; font-size: 14px; color: #10161d; }
.review-date { float: right; font-size: 12px; color: #9aa5b1; }
.review-body { font-size: 14px; color: #3c4753; margin-top: 4px; }
.comment-form-rating select, .ota-form select {
	width: 100%; height: 38px; font-size: 15px; padding: 0 8px;
	border: 1px solid #ccd4dc; -webkit-border-radius: 6px; border-radius: 6px;
	background: #ffffff; -webkit-appearance: none;
}
/* 评论表单（WP 原生 comment_form） */
.comment-respond { margin-top: 2px; }
.comment-logged-in { font-size: 12px; color: #7c8894; margin-bottom: 10px; }
.comment-form-rating, .comment-form-author, .comment-form-email, .comment-form-url, .comment-form-comment { margin-bottom: 10px; }
.comment-form-rating label, .comment-form-author label, .comment-form-email label, .comment-form-url label, .comment-form-comment label {
	display: block; font-size: 13px; color: #5b6875; margin-bottom: 4px;
}
.comment-form-author input, .comment-form-email input, .comment-form-url input {
	width: 100%; height: 40px; padding: 0 10px; font-size: 16px;
	border: 1px solid #ccd4dc; -webkit-border-radius: 6px; border-radius: 6px;
	-webkit-appearance: none; background: #ffffff; color: #1c2530;
	-webkit-box-sizing: border-box; box-sizing: border-box;
}
.comment-form-comment textarea {
	width: 100%; height: 110px; padding: 8px 10px; font-size: 16px; line-height: 1.4;
	border: 1px solid #ccd4dc; -webkit-border-radius: 6px; border-radius: 6px;
	-webkit-appearance: none; background: #ffffff; color: #1c2530; margin-bottom: 2px;
	-webkit-box-sizing: border-box; box-sizing: border-box;
}
.form-submit { margin-bottom: 0; }
.form-submit #submit {
	display: block; width: 100%; margin-top: 6px; padding: 12px 10px;
	font-size: 16px; font-weight: bold; color: #ffffff; border: 1px solid #0857a6;
	background: #0a6dd0;
	background: -webkit-linear-gradient(top, #3d92e6 0%, #0a6dd0 100%);
	background: linear-gradient(to bottom, #3d92e6 0%, #0a6dd0 100%);
	-webkit-border-radius: 8px; border-radius: 8px; -webkit-appearance: none;
	text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

/* ========== 用户系统表单 ========== */
.ota-panel {
	background: #ffffff; border: 1px solid #ccd4dc;
	-webkit-border-radius: 10px; border-radius: 10px;
	padding: 18px 14px; margin-top: 14px;
}
.ota-panel h1 { font-size: 20px; margin-bottom: 14px; color: #10161d; }
.ota-form p { margin-bottom: 12px; }
.ota-form label { display: block; font-size: 13px; color: #5b6875; margin-bottom: 4px; }
.ota-form input[type=text], .ota-form input[type=password], .ota-form input[type=email] {
	width: 100%; height: 40px; padding: 0 10px; font-size: 16px;
	border: 1px solid #ccd4dc; -webkit-border-radius: 6px; border-radius: 6px;
	-webkit-appearance: none; background: #ffffff; color: #1c2530;
}
.ota-form .remember { font-size: 13px; color: #5b6875; }
.ota-form .remember input { margin-right: 6px; }
.btn-main {
	display: block; width: 100%; text-align: center; margin-top: 6px; padding: 12px 10px;
	font-size: 16px; font-weight: bold; color: #ffffff; border: 1px solid #0857a6;
	background: #0a6dd0;
	background: -webkit-linear-gradient(top, #3d92e6 0%, #0a6dd0 100%);
	background: linear-gradient(to bottom, #3d92e6 0%, #0a6dd0 100%);
	-webkit-border-radius: 8px; border-radius: 8px; -webkit-appearance: none;
	text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}
.btn-main:active { background: #0857a6; }
.btn-main[disabled] { background: #a9b4bf; border-color: #8d99a5; color: #eef1f4; }
.btn-secondary {
	display: inline-block; padding: 8px 16px; font-size: 13px; color: #3c4753;
	background: #ffffff; border: 1px solid #ccd4dc;
	-webkit-border-radius: 6px; border-radius: 6px;
}
.form-error {
	border: 1px solid #e0a0a0; background: #fdeaea; color: #a03030;
	padding: 8px 10px; -webkit-border-radius: 6px; border-radius: 6px;
	font-size: 13px; margin-bottom: 12px;
}
.form-ok {
	border: 1px solid #a8cfa0; background: #e8f6e4; color: #2f6b2a;
	padding: 8px 10px; -webkit-border-radius: 6px; border-radius: 6px;
	font-size: 13px; margin-bottom: 12px;
}
.form-alt { text-align: center; font-size: 13px; color: #7c8894; margin-top: 14px; }

/* 个人中心 */
.profile-head { overflow: hidden; padding-bottom: 12px; border-bottom: 1px solid #e4e9ee; margin-bottom: 12px; }
.avatar { float: left; width: 56px; height: 56px; -webkit-border-radius: 8px; border-radius: 8px; margin-right: 12px; border: 1px solid #ccd4dc; }
.profile-name { font-size: 18px; font-weight: bold; color: #10161d; }
.profile-sub { font-size: 12px; color: #7c8894; }

/* ========== 页脚 ========== */
.site-footer { text-align: center; color: #9aa5b1; font-size: 12px; padding: 20px 0 30px 0; }

/* ========== 底部 TabBar（fixed 贴底，display:table 四等分，iOS5 安全） ========== */
.tab-bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
	display: table; table-layout: fixed; width: 100%; height: 49px;
	background: #24303e;
	background: -webkit-linear-gradient(top, #3a4a5c 0%, #24303e 100%);
	background: linear-gradient(to bottom, #3a4a5c 0%, #24303e 100%);
	border-top: 1px solid #10161d;
}
.tab-bar a {
	display: table-cell; text-align: center; vertical-align: middle;
	font-size: 13px; color: #9fb2c6;
}
.tab-bar a:active { background: rgba(0,0,0,0.25); }
.tab-bar a.cur { color: #4da3f2; font-weight: bold; }

/* ========== 安装确认弹窗（仿 iOS 系统样式） ========== */
#ota-modal-mask {
	display: none;
	position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 200;
	background: rgba(0,0,0,0.45);
}
#ota-modal-mask.show { display: block; }
.ota-modal {
	position: fixed; left: 50%; top: 50%; width: 270px;
	margin: -74px 0 0 -135px;
	background: #f4f5f7;
	-webkit-border-radius: 12px; border-radius: 12px;
	overflow: hidden; text-align: center;
}
.ota-modal-title { font-size: 15px; font-weight: bold; color: #1c2530; padding: 18px 14px 4px 14px; word-break: break-word; }
.ota-modal-msg { font-size: 12px; color: #7c8894; min-height: 16px; padding: 2px 14px 14px 14px; }
.ota-modal-btns { border-top: 1px solid #c8ced5; display: table; table-layout: fixed; width: 100%; }
.ota-modal-btns a { display: table-cell; padding: 12px 0; font-size: 15px; color: #0a6dd0; }
.ota-modal-btns a + a { border-left: 1px solid #c8ced5; }
.ota-modal-btns a:active { background: #dfe3e8; }
.ota-modal-btns a.ok { font-weight: bold; }
.ota-modal-btns a.busy { color: #9aa5b1; }

/* ========== 工具类 ========== */
.clearfix { overflow: hidden; }
.clear { clear: both; height: 0; font-size: 0; line-height: 0; }

/* ========== 小屏适配 ========== */
@media only screen and (max-width: 360px) {
	.site-title { font-size: 17px; }
	body { padding-top: 54px; }
	.app-icon { width: 48px; height: 48px; }
	.app-info { margin-left: 58px; margin-right: 74px; min-height: 48px; }
	.btn-get { width: 62px; padding: 6px 0; }
	.app-hero .app-icon { width: 56px; height: 56px; }
	.app-hero .app-info { margin-left: 68px; margin-right: 74px; min-height: 56px; }
	.screens img { width: 120px; }
}
