/* 全局样式 */
:root {
    --primary-color: #2ecc71;
    --secondary-color: #27ae60;
    --accent-color: #3498db;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #2ecc71;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #ecf0f1;
    --bg-white: #ffffff;
    --border-color: #dfe6e9;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding-bottom: 60px;
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow-x: hidden;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
}

.logo i {
    font-size: 28px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* 主内容 */
.main-content {
    padding: 30px 0;
}

/* 标语区 */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 40px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.hero-section h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-light);
}

/* 工具卡片网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.tool-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tool-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card.hot::before {
    transform: scaleX(1);
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header i {
    font-size: 36px;
    color: var(--primary-color);
}

.tool-card.hot .card-header i {
    color: #ff6b6b;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.hot-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.v2-badge {
    background: var(--text-light);
    color: white;
}

.tool-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.tool-card p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 14px;
}

.card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.card-features span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 4px 10px;
    border-radius: 12px;
}

.card-features i {
    color: var(--success-color);
    font-size: 10px;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--primary-color);
    font-weight: bold;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.tool-card.hot .card-action {
    color: #ff6b6b;
}

.tool-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-card.coming-soon:hover {
    transform: none;
}

/* 特色说明 */
.features-section {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 28px;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.feature-item p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* 快速指南 */
.quick-guide {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.quick-guide h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
    font-size: 28px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.step h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.step p {
    font-size: 14px;
    color: var(--text-light);
}

/* 页脚 */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer p {
    margin-bottom: 10px;
}

.disclaimer {
    font-size: 12px;
    color: var(--warning-color);
}

.tech-info {
    font-size: 12px;
    opacity: 0.7;
}

.tech-info a {
    color: white;
    text-decoration: none;
}

.tech-info a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-bottom: 40px;
    }

    .container {
        padding: 0 15px;
    }

    .hero-section {
        padding: 30px 15px;
    }

    .hero-section h1 {
        font-size: 24px;
        word-break: break-word;
    }

    .hero-desc {
        font-size: 14px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        padding: 20px;
    }

    .features-section,
    .quick-guide {
        padding: 30px 15px;
    }

    .features-list,
    .steps {
        grid-template-columns: 1fr;
    }

    .calculator-page {
        padding: 20px 15px;
        margin: 15px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    /* 防止表格溢出 */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 防止长文本溢出 */
    .result-section,
    .form-group,
    .alert {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* 移动端弹框优化 */
    #access-dialog > div {
        padding: 25px 15px !important;
        width: calc(100% - 30px) !important;
        max-width: calc(100vw - 30px) !important;
    }

    #access-dialog h2 {
        font-size: 20px !important;
    }

    #access-dialog h4 {
        font-size: 16px !important;
    }

    #access-dialog p {
        font-size: 14px !important;
    }

    /* 试用横幅移动端优化 */
    #trial-banner {
        font-size: 12px !important;
        padding: 12px 15px !important;
    }

    #trial-banner span {
        font-size: 12px !important;
    }

    #trial-banner button {
        font-size: 12px !important;
        padding: 6px 15px !important;
    }
}

/* 超小屏幕优化（<400px） */
@media (max-width: 400px) {
    .container {
        padding: 0 10px;
    }

    .hero-section {
        padding: 20px 10px;
    }

    .hero-section h1 {
        font-size: 20px;
    }

    .tool-card {
        padding: 15px;
    }

    .features-section,
    .quick-guide {
        padding: 20px 10px;
    }

    .calculator-page {
        padding: 15px 10px;
        margin: 10px;
    }

    /* 弹框更紧凑 */
    #access-dialog {
        padding: 15px !important;
    }

    #access-dialog > div {
        padding: 20px 12px !important;
        width: calc(100% - 20px) !important;
    }

    #access-dialog h2 {
        font-size: 18px !important;
    }

    #access-dialog button {
        padding: 12px !important;
        font-size: 14px !important;
    }

    #access-dialog input {
        padding: 12px !important;
        font-size: 14px !important;
    }
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 计算器页面通用样式 */
.calculator-page {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin: 30px auto;
    max-width: 900px;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.page-header p {
    color: var(--text-light);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 600;
}

.back-btn:hover {
    text-decoration: underline;
}

.result-section {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
}

.result-section h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-danger {
    background: #fee;
    border-left: 4px solid var(--danger-color);
    color: #c0392b;
}

.alert-warning {
    background: #fff8e1;
    border-left: 4px solid var(--warning-color);
    color: #e67e22;
}

.alert-success {
    background: #eafaf1;
    border-left: 4px solid var(--success-color);
    color: #27ae60;
}

.alert-info {
    background: #e3f2fd;
    border-left: 4px solid var(--accent-color);
    color: #2980b9;
}