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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 920px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    padding: 40px 20px;
}

/* 品牌链接 */
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    margin-bottom: 12px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.brand-link:hover {
    opacity: 1;
}

.brand-logo {
    font-size: 1.4rem;
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* 分享按钮 */
.share-float {
    text-align: center;
    padding: 16px 0 8px;
}

.share-float .share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-float .share-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.share-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.78);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 10000;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab:hover {
    color: #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group label .badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.form-group label .badge.highlight {
    background: #667eea;
}

.form-group label .required {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group .form-control {
    border-radius: 10px 0 0 10px;
    flex: 1;
}

.input-group .unit {
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 10px 10px 0;
    color: #6c757d;
    font-weight: 500;
}

.help-text {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 14px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

.deduction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.deduction-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.deduction-item:hover {
    border-color: #667eea;
}

.deduction-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.deduction-item label {
    margin: 0;
    flex: 1;
    cursor: pointer;
    font-weight: 400;
}

.deduction-item .amount {
    color: #667eea;
    font-weight: 500;
    font-size: 14px;
}

.deduction-item .small-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.result-section {
    margin-top: 30px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
}

.result-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.result-item .label {
    display: block;
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
}

.result-item .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.result-item .value.deduct {
    color: #dc3545;
}

.result-item .value.tax {
    color: #fd7e14;
}

.result-item .value.income {
    color: #28a745;
}

.result-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.result-item.highlight .label,
.result-item.highlight .value {
    color: white;
}

.result-item.important {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.result-item.important .label,
.result-item.important .value {
    color: white;
}

.tax-detail {
    margin-top: 20px;
    padding: 16px;
    background: white;
    border-radius: 12px;
}

.tax-detail h4 {
    color: #333;
    margin-bottom: 12px;
}

.tax-detail table {
    width: 100%;
    border-collapse: collapse;
}

.tax-detail th,
.tax-detail td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.tax-detail th {
    background: #f8f9fa;
    font-weight: 600;
}

.ai-suggestions {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    border-left: 4px solid #2196f3;
}

.ai-suggestions h4 {
    color: #1976d2;
    margin-bottom: 12px;
}

.ai-suggestions ul {
    list-style: none;
    padding: 0;
}

.ai-suggestions li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #333;
}

.ai-suggestions li::before {
    content: "💡";
    position: absolute;
    left: 0;
}

.faq-section {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.faq-section h2 {
    color: #333;
    margin-bottom: 24px;
    text-align: center;
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.faq-item p {
    color: #6c757d;
    line-height: 1.6;
}

/* 工具导航样式 */
.tool-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-item.active {
    background: white;
    color: #667eea;
}

.nav-icon {
    font-size: 18px;
}

/* 同步提示样式 */
.sync-notice {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-notice .sync-icon {
    font-size: 20px;
}

.sync-notice span {
    flex: 1;
    color: #155724;
    font-weight: 500;
}

.btn-sync {
    background: white;
    color: #28a745;
    border: 1px solid #28a745;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sync:hover {
    background: #28a745;
    color: white;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.radio-item:hover {
    border-color: #667eea;
}

.radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.radio-item span {
    font-weight: 500;
    color: #333;
}

.radio-item input[type="radio"]:checked + span {
    color: #667eea;
}

.radio-item:has(input:checked) {
    border-color: #667eea;
    background: #e3f2fd;
}

/* 广告位样式 */
.ad-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0;
    display: none;
}

.ad-placeholder span {
    color: #adb5bd;
    font-size: 14px;
}

.ad-placeholder.wide {
    margin: 30px 0;
}

.ad-placeholder.inline {
    margin: 20px 0;
    padding: 30px 20px;
}

/* 个税税率表样式 */
.tax-rate-table {
    margin-top: 30px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tax-rate-table h4 {
    color: #333;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.tax-rate-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tax-rate-table th,
.tax-rate-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.tax-rate-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.tax-rate-table tbody tr:hover {
    background: #f8f9fa;
}

.tax-rate-table tbody tr.current-rate {
    background: #e3f2fd;
    border-left: 3px solid #667eea;
}

.tax-rate-table tbody tr.current-rate td {
    font-weight: 600;
    color: #667eea;
}

.tax-rate-note {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 30px;
    color: white;
}

footer a {
    color: white;
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .tool-nav {
        gap: 8px;
        flex-wrap: wrap;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .deduction-grid {
        grid-template-columns: 1fr;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
}