/* ==========================================
   中国企业社保与公积金负担计算器 - 样式表
   ========================================== */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #06b6d4;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 页面标题 */
header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bg-white);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

/* 卡片样式 */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.8s ease;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

/* 表单样式 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--accent-color);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
    font-style: italic;
}

/* 计算按钮 */
.btn-calculate {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    box-shadow: var(--shadow-md);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #1d4ed8, #0891b2);
}

.btn-calculate:active {
    transform: translateY(0);
}

/* 结果区域 */
.result-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px dashed var(--border-color);
    animation: fadeIn 0.5s ease;
}

.result-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.result-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.result-card.company {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
}

.result-card.employee {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
}

.result-card.total {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: var(--secondary-color);
}

.result-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.result-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.result-card .amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.result-card .amount.large {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.result-card .note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 10px;
}

.breakdown {
    font-size: 0.9rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item span:first-child {
    color: var(--text-light);
}

.breakdown-item span:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

/* 广告区域 */
.ad-section {
    margin: 40px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 公式区域 */
.formula-group {
    margin-bottom: 30px;
}

.formula-group h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

.formula-item {
    margin-bottom: 20px;
}

.formula-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.formula-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.95rem;
}

.formula-box p {
    margin-bottom: 10px;
}

.formula-box p:last-child {
    margin-bottom: 0;
}

.formula-box strong {
    color: var(--text-dark);
    font-weight: 600;
}

.formula-box .note {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 10px;
}

/* 示例区域 */
.example {
    margin-bottom: 30px;
}

.example h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.example-params {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.example-params p {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.example-params ul {
    list-style: none;
    padding-left: 0;
}

.example-params li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.example-params li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.example-calculation h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 20px 0 15px 0;
}

.calc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.calc-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.calc-table th,
.calc-table td {
    padding: 12px 15px;
    text-align: left;
}

.calc-table tbody tr {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.calc-table tbody tr:hover {
    background: var(--bg-light);
}

.calc-table tbody tr:last-child {
    border-bottom: none;
}

.calc-table .total-row {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    font-weight: 700;
}

.calc-table .total-row:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.example-summary {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.example-summary p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.example-summary p:last-child {
    margin-bottom: 0;
}

.example-summary .highlight {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

/* 详细说明区域 */
.info-group {
    margin-bottom: 30px;
}

.info-group h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

.info-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 20px 0 10px 0;
}

.info-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.info-content ul {
    margin-bottom: 15px;
    padding-left: 25px;
}

.info-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.info-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--bg-white);
    margin-top: 40px;
}

footer p {
    margin-bottom: 5px;
}

footer .disclaimer {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-card .amount {
        font-size: 1.5rem;
    }

    .result-card .amount.large {
        font-size: 2rem;
    }

    .calc-table {
        font-size: 0.9rem;
    }

    .calc-table th,
    .calc-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 15px;
    }

    .calc-table {
        font-size: 0.85rem;
    }

    .calc-table th,
    .calc-table td {
        padding: 6px 8px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }

    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .btn-calculate {
        display: none;
    }

    .ad-section {
        display: none;
    }
}
