/* H5 移动端样式 */
:root {
    --h5-header-height: 52px;
    --h5-tabbar-height: 58px;
    --h5-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.h5-app {
    background: #f3f4f6;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--h5-tabbar-height) + var(--h5-safe-bottom));
}

.h5-app.h5-no-tabbar {
    padding-bottom: var(--h5-safe-bottom);
}

.h5-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--h5-header-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

.tool-tabs-bar-h5 {
    top: var(--h5-header-height);
    z-index: 90;
    padding: 8px 0;
}

.tool-tabs-bar-h5 .container {
    padding-left: 12px;
    padding-right: 12px;
}

.tool-tabs-bar-h5 .tool-tab {
    min-width: 68px;
    padding: 8px 10px;
    font-size: 12px;
}

.h5-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    padding: 0 14px;
}

.h5-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-900);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.h5-brand-icon { font-size: 20px; }

.h5-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 20px;
    cursor: pointer;
}

.h5-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.h5-header-actions {
    min-width: 72px;
    display: flex;
    justify-content: flex-end;
}

.h5-points-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
}

.h5-link-btn {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.h5-main {
    padding: 14px;
}

.h5-hero {
    padding: 22px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
}

.h5-hero h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.h5-hero p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.92;
}

.h5-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.h5-user-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

.h5-user-card span {
    color: var(--gray-500);
    font-size: 13px;
}

.h5-section-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.h5-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.h5-tool-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 14px;
    border: none;
    border-radius: 16px;
    background: #fff;
    text-align: left;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.h5-tool-card-icon {
    font-size: 28px;
}

.h5-tool-card strong {
    font-size: 15px;
    color: var(--gray-900);
}

.h5-tool-card span {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}

.h5-tip-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    color: var(--gray-600);
    font-size: 13px;
    line-height: 1.6;
    box-shadow: var(--shadow);
}

.h5-tip-card a {
    color: var(--primary);
    font-weight: 600;
}

.h5-tool-view {
    display: none;
}

.h5-tool-toolbar {
    margin-bottom: 12px;
}

.h5-tool-toolbar .h5-back-btn {
    width: auto;
    padding: 0 14px;
    font-size: 14px;
}

.h5-app.is-tool-mode .h5-home-view {
    display: none;
}

.h5-app.is-tool-mode .h5-tool-view {
    display: block;
}

.h5-app.is-tool-mode {
    padding-bottom: var(--h5-safe-bottom);
}

.h5-app.is-tool-mode .h5-tabbar {
    display: none;
}

.h5-tool-view .tool-grid {
    grid-template-columns: 1fr;
}

.h5-tool-view .tool-preview {
    order: -1;
}

.h5-tool-view .preview-area {
    min-height: 180px;
}

.h5-tool-view .tool-controls .btn,
.h5-tool-view .tool-actions .btn {
    width: 100%;
}

.h5-tool-view .tool-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.h5-auth-page {
    max-width: 420px;
    margin: 0 auto;
}

.h5-auth-card {
    padding: 24px 18px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.h5-auth-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.h5-auth-card .auth-desc {
    margin: 0 0 20px;
    color: var(--gray-500);
    font-size: 14px;
}

.h5-auth-card .form-group {
    margin-bottom: 16px;
}

.h5-auth-card label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.h5-auth-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
}

.h5-auth-link {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
}

.h5-auth-link a {
    color: var(--primary);
    font-weight: 600;
}

.h5-member-card {
    padding: 20px 18px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
}

.h5-member-card .label {
    font-size: 13px;
    opacity: 0.9;
}

.h5-member-card .value {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    margin: 8px 0 14px;
}

.h5-member-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.h5-stat-box {
    padding: 14px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.h5-stat-box span {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    margin-bottom: 4px;
}

.h5-stat-box strong {
    font-size: 18px;
}

.h5-menu-list {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.h5-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    color: var(--gray-900);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
}

.h5-menu-item:last-child {
    border-bottom: none;
}

.h5-menu-item small {
    color: var(--gray-400);
}

.h5-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    height: calc(var(--h5-tabbar-height) + var(--h5-safe-bottom));
    padding-bottom: var(--h5-safe-bottom);
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

.h5-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--gray-400);
    font-size: 11px;
    text-decoration: none;
}

.h5-tabbar-item.is-active {
    color: var(--primary);
}

.h5-tabbar-icon {
    font-size: 20px;
}

.h5-app .site-header,
.h5-app .site-footer {
    display: none;
}

.h5-app .support-widget[data-position="right"] {
    bottom: calc(var(--h5-tabbar-height) + 16px + var(--h5-safe-bottom));
}

.h5-app.is-tool-mode .support-widget[data-position="right"] {
    bottom: calc(16px + var(--h5-safe-bottom));
}

.h5-app .member-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
}

.h5-app .plan-grid {
    grid-template-columns: 1fr;
}

.h5-app .member-page .page-header {
    display: none;
}

.h5-desktop-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}

.h5-desktop-link a {
    color: var(--gray-500);
}
