/* ============================================
   联通易报税系统 - 前台样式（扁平化+响应式）
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}
a { color: #1e88e5; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font-family: inherit; font-size: inherit; outline: none; }

/* 顶部导航 */
.top-bar {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(25,118,210,0.15);
}
.logo-area { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: bold; }
.logo-area img { height: 32px; width: auto; border-radius: 6px; }
.logo-emoji { font-size: 26px; }
.user-area { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-area .phone { font-size: 13px; opacity: 0.9; }
.btn-link {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.btn-link:hover { background: rgba(255,255,255,0.3); }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 12px; }

/* 幻灯片 */
.slider-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #e3f2fd;
    aspect-ratio: 16/7;
    max-height: 40vh;
}
.slider-inner {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}
.slide-item {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    display: block;
    background-color: #2196f3;
}
.slide-item::before {
    display: none;
}
.slide-caption {
    position: relative;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    padding: 16px;
}
.slide-caption h2 { font-size: 24px; margin-bottom: 8px; }
.slide-caption p { font-size: 14px; opacity: 0.9; }
.slide-dots {
    position: absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.slide-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.slide-dot.active { background: #fff; width: 20px; border-radius: 4px; }

/* 公告 */
.notice-bar {
    background: #fff9e6;
    border-bottom: 1px solid #ffe082;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 42px;
    overflow: hidden;
    position: relative;
}
.notice-icon { font-size: 18px; margin-right: 10px; flex-shrink: 0; }
.notice-wrap {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}
.notice-track {
    position: absolute;
    top: 0; left: 0; right: 0;
    transition: transform 0.6s ease;
}
.notice-item {
    height: 42px;
    line-height: 42px;
    color: #e65100;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 40px;
}

/* 区块 */
.section {
    background: #fff;
    border-radius: 12px;
    margin: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid #2196f3;
    padding-left: 10px;
}

/* 首页菜单网格 */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    text-align: center;
}
.menu-item:active { transform: scale(0.95); background: #f0f7ff; }
.menu-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border-radius: 14px;
    font-size: 28px;
    color: #fff;
    margin-bottom: 6px;
    box-shadow: 0 3px 8px rgba(33,150,243,0.3);
}
.menu-icon img { width: 32px; height: 32px; object-fit: contain; }
.menu-name { font-size: 12px; color: #444; }

/* 文章列表 */
.article-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.article-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #f0f0f0;
}
.article-card:active { background: #f5faff; }
.article-cover {
    width: 110px; height: 78px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f0f4f8;
    background-size: cover;
    background-position: center;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    color: #90caf9;
}
.article-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.article-title { font-size: 14px; font-weight: bold; color: #222; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-summary { font-size: 12px; color: #888; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.article-date { font-size: 11px; color: #bbb; margin-top: 4px; }

/* 友情链接 */
.link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.link-item {
    padding: 5px 12px;
    background: #f0f7ff;
    color: #1976d2;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #e3f2fd;
}
.link-item:active { background: #e3f2fd; }

/* ICP */
.icp-bar { text-align: center; padding: 14px 12px; font-size: 12px; color: #aaa; }
.icp-bar a { color: #aaa; }
.icp-bar .icp-sep { color: #ddd; }
.icp-bar .footer-copyright { color: #aaa; }

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #eaeaea;
    display: flex;
    z-index: 99;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    color: #999;
    cursor: pointer;
    font-size: 11px;
    transition: color 0.2s;
    text-align: center;
    min-width: 0;
}
.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
    line-height: 1;
    font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}
.nav-icon img { width: 22px; height: 22px; object-fit: contain; }
.nav-item.active { color: #1976d2; }
.nav-item:active { opacity: 0.7; }
.nav-item.has-children { position: relative; }
.nav-arrow { font-size: 9px; margin-left: 2px; opacity: 0.7; }
.nav-item.has-children.active .nav-icon,
.nav-item.has-children.active .nav-text { color: #1976d2; }
.nav-item .nav-icon { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.nav-item .nav-icon img { width: 24px; height: 24px; object-fit: contain; }
.nav-item .nav-text { font-size: 11px; line-height: 1.2; display: flex; align-items: center; }

/* 仿微信公众号子菜单浮层 */
.submenu-mask {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.4);
    display: none;
}
.submenu-popup {
    position: fixed;
    z-index: 101;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    padding: 6px 0;
    min-width: 180px;
    max-width: 80vw;
    display: none;
}
.submenu-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}
.submenu-popup.submenu-down::after {
    bottom: auto; top: -8px;
    border-top: none;
    border-bottom: 8px solid #fff;
}
.submenu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    gap: 10px;
    transition: background 0.15s;
    white-space: nowrap;
}
.submenu-item:active { background: #f5f7fa; }
.submenu-item + .submenu-item { border-top: 1px solid #f0f0f0; }
.submenu-icon-emoji { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
.submenu-icon-img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.submenu-text { flex: 1; }
.submenu-tel-badge {
    font-size: 11px;
    background: linear-gradient(135deg,#4caf50,#2e7d32);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 页面头部（非首页） */
.page-header {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: #fff;
    padding: 30px 16px;
}
.page-header h1 { font-size: 22px; margin-bottom: 6px; }
.page-header p { font-size: 13px; opacity: 0.9; }

/* 表单 */
.form-section { margin: 12px; }
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: #fafbfc;
    transition: border-color 0.2s, background 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: #2196f3;
    background: #fff;
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-input { flex: 1; }
.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30,136,229,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(30,136,229,0.3); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}
.btn-blue { background: #2196f3; color: #fff; }
.btn-red { background: #f44336; color: #fff; }
.btn-gray { background: #f0f0f0; color: #666; }

/* 上传区域 */
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.upload-box {
    aspect-ratio: 1;
    border: 2px dashed #bbdefb;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f8fbff;
    color: #90caf9;
    font-size: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}
.upload-box:hover { border-color: #2196f3; background: #f0f7ff; }
.upload-box .ub-icon { font-size: 32px; margin-bottom: 4px; }
.upload-box.has-file { border-style: solid; border-color: #2196f3; }
.upload-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-box .remove-btn {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 2;
}
.upload-tip { font-size: 12px; color: #999; margin-top: 6px; }

/* 订单卡片 */
.order-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border-left: 4px solid #ffa726;
}
.order-card.done { border-left-color: #66bb6a; }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-id { font-size: 13px; color: #666; }
.order-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}
.status-pending { background: #fff3e0; color: #ef6c00; }
.status-done { background: #e8f5e9; color: #2e7d32; }
.order-info { font-size: 13px; color: #555; line-height: 1.8; }
.empty-tip {
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
}
.empty-tip .empty-icon { font-size: 48px; margin-bottom: 10px; }

/* 文章详情 */
.article-detail {
    background: #fff;
    margin: 12px;
    padding: 20px 16px;
    border-radius: 12px;
    min-height: 300px;
}
.article-detail h1 { font-size: 20px; margin-bottom: 12px; color: #222; }
.article-detail .ad-meta { font-size: 12px; color: #aaa; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.article-detail .ad-content { font-size: 15px; line-height: 1.8; color: #333; }
.article-detail .ad-content img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.article-detail .ad-content p { margin-bottom: 12px; }
.back-link {
    display: inline-block;
    margin: 12px;
    color: #1976d2;
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
    pointer-events: none;
    animation: toastIn 0.2s;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%,-50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* 模态弹窗 */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 20px;
    position: relative;
    animation: modalIn 0.25s;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}
.modal-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #1976d2;
}
.modal-title .modal-icon { font-size: 28px; margin-right: 6px; }
.modal-switch {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-top: 14px;
}
.modal-switch a { color: #1976d2; cursor: pointer; }

/* 协议勾选 */
.agree-row { margin: 10px 0 2px; font-size: 12px; color: #888; }
.agree-label { display: flex; align-items: flex-start; gap: 6px; line-height: 1.6; cursor: pointer; user-select: none; }
.agree-check { margin-top: 3px; flex-shrink: 0; width: 14px; height: 14px; accent-color: #1976d2; cursor: pointer; }
.agree-label a { color: #1976d2; text-decoration: none; }
.agree-label a:active { text-decoration: underline; }
.agree-label.shake { animation: agreeShake 0.4s ease; }
@keyframes agreeShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* 登录Tab切换 */
.tab-bar { display: flex; border-bottom: 1px solid #eee; margin-bottom: 16px; }
.tab-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    border-bottom: 2px solid transparent;
}
.tab-item.active { color: #1976d2; border-bottom-color: #1976d2; font-weight: bold; }
.code-btn {
    padding: 0 12px;
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.code-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 加载提示 */
.loading-tip { text-align: center; padding: 30px; color: #aaa; font-size: 14px; }
.loading-icon { font-size: 28px; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 响应式 ==================== */
/* 手机横屏 */
@media (max-height: 520px) and (orientation: landscape) {
    body { padding-bottom: 60px; }
    .top-bar { padding: 8px 12px; }
    .logo-area { font-size: 16px; }
    .logo-emoji { font-size: 20px; }
    .page-header { padding: 16px 14px; }
    .page-header h1 { font-size: 18px; }
    .slider-wrap { aspect-ratio: 16/5; }
    .slide-caption h2 { font-size: 18px; }
    .section { padding: 12px; margin: 8px; }
    .section-title { font-size: 14px; margin-bottom: 10px; }
    .menu-grid { gap: 8px; }
    .menu-icon { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
    .menu-icon img { width: 24px; height: 24px; }
    .menu-name { font-size: 11px; }
    .nav-item { padding: 4px 2px; font-size: 10px; }
    .nav-icon { font-size: 18px; }
    .nav-icon img { width: 18px; height: 18px; }
    .notice-bar { height: 36px; }
    .notice-item { height: 36px; line-height: 36px; font-size: 13px; }
}

/* 平板竖屏 */
@media (min-width: 600px) {
    body { font-size: 15px; padding-bottom: 84px; }
    .container { padding: 0 16px; }
    .top-bar { padding: 14px 20px; }
    .logo-area { font-size: 20px; }
    .menu-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .menu-icon { width: 64px; height: 64px; font-size: 34px; }
    .menu-icon img { width: 40px; height: 40px; }
    .menu-name { font-size: 13px; }
    .section { padding: 20px; margin: 16px; border-radius: 16px; }
    .article-card { padding: 12px; }
    .article-cover { width: 140px; height: 100px; }
    .article-title { font-size: 16px; }
    .article-summary { font-size: 13px; }
}

/* 平板横屏 */
@media (min-width: 992px) {
    body { padding-bottom: 0; }
    .menu-grid { grid-template-columns: repeat(4, 1fr); }
    .article-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .bottom-nav { position: static; margin-top: 20px; border-top: 1px solid #eaeaea; }
    .upload-grid { grid-template-columns: repeat(3, 180px); }
    .form-section { max-width: 700px; margin: 16px auto; }
}

/* 桌面端 */
@media (min-width: 1200px) {
    .container { max-width: 1200px; }
    .slider-wrap { aspect-ratio: 16/6; border-radius: 0 0 16px 16px; }
    .menu-grid { grid-template-columns: repeat(4, 1fr); }
    .slide-caption h2 { font-size: 32px; }
    .slide-caption p { font-size: 16px; }
}

/* 超宽屏 */
@media (min-width: 1600px) {
    .container { max-width: 1400px; }
}
