/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 65px;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* ========== 顶部头部 ========== */
.site-header {
    display: flex;
    align-items: center;
    padding: 20px 16px 18px;
    gap: 12px;
}

.site-logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5b8def 0%, #4a6fd4 50%, #6b4ae0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(74, 111, 212, 0.3);
    position: relative;
    overflow: hidden;
}

.site-logo .logo-inner {
    width: 38px;
    height: 42px;
    background: linear-gradient(180deg, #ff6b35 0%, #e74c3c 100%);
    border-radius: 5px 5px 3px 3px;
    position: relative;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
}

.site-logo .logo-inner::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 6px;
    right: 6px;
    height: 2px;
    background: rgba(255,255,255,0.5);
    border-radius: 1px;
}

.site-logo .logo-pen {
    position: absolute;
    bottom: 6px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(41, 128, 185, 0.5);
}

.site-logo .logo-pen svg {
    width: 12px;
    height: 12px;
    fill: #fff;
}

.site-info {
    flex: 1;
}

.site-title {
    font-size: 19px;
    font-weight: 700;
    color: #5b8def;
    margin-bottom: 4px;
}

.site-subtitle {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* ========== 按钮组 ========== */
.btn-group {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 14px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
}

.btn-group .big-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    background: linear-gradient(135deg, #6ba3e8 0%, #5b95dd 100%);
    color: #fff;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-group .big-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-group .big-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ========== 卡片通用样式 ========== */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 18px 16px;
    margin-bottom: 14px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
}

/* ========== FAQ 常见问题 ========== */
.faq-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
    color: #222;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.faq-item {
    border: 1.5px solid #d0d5dd;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item.active {
    border-color: #5b8def;
}

.faq-question {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    gap: 9px;
    background: #fff;
    transition: background 0.2s;
}

.faq-question:active {
    background: #f7f8fa;
}

.faq-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-icon svg {
    width: 18px;
    height: 18px;
}

.faq-icon.warning svg {
    fill: #f59e0b;
}

.faq-icon.apple svg {
    fill: #555;
}

.faq-question-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.faq-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s;
    color: #5b8def;
}

.faq-arrow svg {
    width: 18px;
    height: 18px;
    fill: #5b8def;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    padding: 0 12px;
    background: #fafbfc;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 12px 12px;
}

.faq-answer p {
    font-size: 12px;
    color: #666;
    line-height: 1.7;
    white-space: pre-line;
}

/* ========== 安装步骤 ========== */
.steps-section {
    text-align: center;
}

.step-item {
    margin-bottom: 14px;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-text {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
}

.step-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6ba3e8 0%, #5b95dd 100%);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(91, 149, 221, 0.3);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.step-btn:active {
    transform: scale(0.94);
}

.step-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* ========== 购买提示 ========== */
.purchase-section {
    text-align: center;
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.purchase-title {
    font-size: 19px;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}

.purchase-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.purchase-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6ba3e8 0%, #5b95dd 100%);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(91, 149, 221, 0.3);
    margin-bottom: 12px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.purchase-btn:active {
    transform: scale(0.94);
}

.purchase-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.purchase-reminder {
    font-size: 13px;
    color: #e74c3c;
    line-height: 1.6;
    font-weight: 500;
    text-align: center;
}

/* ========== 签名工具列表 ========== */
.tool-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tool-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tool-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
}

.tool-icon.qns {
    background: linear-gradient(135deg, #5b8def 0%, #4a6fd4 50%, #6b4ae0 100%);
    position: relative;
    overflow: hidden;
}

.tool-icon.qns .icon-inner {
    width: 26px;
    height: 29px;
    background: linear-gradient(180deg, #ff6b35 0%, #e74c3c 100%);
    border-radius: 3px 3px 2px 2px;
    position: relative;
}

.tool-icon.qns .icon-inner::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    right: 4px;
    height: 1.5px;
    background: rgba(255,255,255,0.5);
    border-radius: 1px;
}

.tool-icon.qns .icon-pen {
    position: absolute;
    bottom: 4px;
    right: 3px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
}

.tool-icon.qss {
    background: linear-gradient(135deg, #74b9ff 0%, #5b9def 100%);
    font-style: italic;
    font-size: 12px;
    font-family: Georgia, serif;
}

.tool-icon.xbs {
    background: linear-gradient(135deg, #5ec9c9 0%, #3da8a8 100%);
    font-size: 10px;
    flex-direction: column;
    line-height: 1.2;
}

.tool-icon.xbs .xbs-top {
    font-size: 14px;
    font-weight: 700;
}

.tool-icon.xbs .xbs-bottom {
    font-size: 9px;
    font-weight: 500;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 3px;
}

.tool-cert {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 警告提示 */
.tool-warning {
    background: #fef2f2;
    border-radius: 6px;
    padding: 7px 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.tool-warning.success {
    background: #f0fdf4;
}

.tool-warning .warn-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.tool-warning .warn-icon svg {
    width: 14px;
    height: 14px;
}

.tool-warning .warn-text {
    font-size: 12px;
    color: #dc2626;
    line-height: 1.5;
    flex: 1;
}

.tool-warning.success .warn-text {
    color: #16a34a;
}

/* 按钮组 */
.tool-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tool-btn {
    flex: 1;
    max-width: 130px;
    padding: 6px 8px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.tool-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.tool-btn.primary {
    background: linear-gradient(135deg, #6ba3e8 0%, #5b95dd 100%);
    box-shadow: 0 2px 8px rgba(91, 149, 221, 0.3);
}

.tool-btn.success {
    background: linear-gradient(135deg, #6dc77d 0%, #5ab86a 100%);
    box-shadow: 0 2px 8px rgba(90, 184, 106, 0.3);
}

.tool-btn.single {
    max-width: 110px;
    margin-left: auto;
}

/* ========== 底部 ========== */
.site-footer {
    text-align: center;
    padding: 14px 12px 8px;
}

.safari-tip {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.safari-tip .sparkle {
    color: #f59e0b;
}

.copyright {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
}

.divider {
    border: none;
    border-top: 1px dashed #ddd;
    margin: 14px 0;
}

/* ========== 底部悬浮导航 ========== */
.bottom-nav-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 4px 0 8px 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 99999;
    border-radius: 16px 16px 0 0;
}

.bottom-nav-fixed .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #999999;
    text-decoration: none;
}

.bottom-nav-fixed .bn-item.bn-active {
    color: #5ab86a;
}

.bottom-nav-fixed .bn-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-fixed .bn-icon svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.bottom-nav-fixed .bn-item.bn-active .bn-icon {
    background: linear-gradient(135deg, #6dc77d 0%, #5ab86a 100%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-top: -18px;
    box-shadow: 0 3px 10px rgba(90, 184, 106, 0.4);
}

.bottom-nav-fixed .bn-item.bn-active .bn-icon svg {
    fill: #ffffff;
    width: 18px;
    height: 18px;
}

.bottom-nav-fixed .bn-text {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
    .container {
        max-width: 520px;
    }
}

@media (max-width: 360px) {
    .site-title {
        font-size: 17px;
    }
    .site-subtitle {
        font-size: 11px;
    }
    .site-logo {
        width: 52px;
        height: 52px;
    }
    .faq-title {
        font-size: 18px;
    }
    .tool-name {
        font-size: 15px;
    }
}