/**
 * 数电票开票申请系统 - 样式表
 * 
 * @author 呆窝云
 * @email service@dwoyun.com
 */

:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #d9d9d9;
    --bg-color: #f5f5f5;
    --white: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    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;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.header .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.nav-tabs {
    display: flex;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(24, 144, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    background: var(--white);
    border-bottom: 2px solid var(--primary-color);
}

.main-content {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.tab-content {
    display: none;
}

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

.qr-entry {
    text-align: center;
    padding: 40px 20px;
}

.qr-placeholder {
    margin-bottom: 30px;
}

.qr-code-box {
    display: inline-block;
    padding: 15px;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.qr-code-box img {
    width: 200px;
    height: 200px;
    display: block;
}

.qr-code-placeholder {
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
}

.qr-code-placeholder .qr-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.qr-code-placeholder p {
    font-size: 12px;
    color: #999;
}

.qr-title {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.qr-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.qr-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.qr-hint {
    font-size: 12px;
    color: #999;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #e8e8e8;
}

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

.btn-danger {
    background: var(--error-color);
    color: var(--white);
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.invoice-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--primary-color);
}

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

.required {
    color: var(--error-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    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);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--error-color);
}

.error-msg {
    display: block;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
}

.hint-text {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 3px;
}

.tax-info {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    padding: 10px 12px;
    background: #f0f5ff;
    border-radius: 6px;
    font-size: 13px;
    color: #1d39c4;
}

.tax-info .tax-rate,
.tax-info .tax-amount {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tax-info b {
    color: #1890ff;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.query-form {
    max-width: 500px;
    margin: 0 auto;
}

.query-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.query-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.query-tab:hover {
    color: var(--primary-color);
}

.query-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.query-input-group {
    display: none;
}

.query-input-group.active {
    display: block;
}

.query-input-group .form-group {
    margin-bottom: 15px;
}

.query-result {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.result-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
}

.result-card .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
}

.status-pending {
    background: #fff7e6;
    color: var(--warning-color);
}

.status-processing {
    background: #e6f7ff;
    color: var(--primary-color);
}

.status-completed {
    background: #f6ffed;
    color: var(--success-color);
}

.status-rejected {
    background: #fff2f0;
    color: var(--error-color);
}

.result-item {
    display: flex;
    margin-bottom: 8px;
}

.result-item .label {
    width: 100px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.result-item .value {
    flex: 1;
    word-break: break-all;
}

.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    margin-top: 15px;
    color: var(--text-secondary);
}

.success-icon {
    font-size: 48px;
    color: var(--success-color);
    margin-bottom: 15px;
}

.success-title {
    font-size: 18px;
    color: var(--success-color);
    margin-bottom: 10px;
}

.success-info {
    background: var(--bg-color);
    padding: 15px;
    border-radius: var(--radius);
    margin: 15px 0;
}

.success-info p {
    margin-bottom: 5px;
}

.success-info .highlight {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}

.form-group-half {
    flex: 1;
    min-width: 0;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f4ff 100%);
    border: 1px solid #d6e4ff;
    border-radius: 8px;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, #e6f4ff 0%, #d6e4ff 100%);
    border-color: #1890ff;
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.toggle-btn.expanded .toggle-icon {
    transform: rotate(90deg);
}

.extra-fields-container {
    margin-top: 15px;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #d9d9d9;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-title {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.invoice-form {
    max-width: 700px;
    margin: 0 auto;
}

.invoice-qrcode-section {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f4ff 100%);
    border-radius: 12px;
    margin-top: 15px;
}

.invoice-qrcode-section .label {
    font-size: 16px;
    font-weight: 600;
    color: #1890ff;
    margin-bottom: 15px;
}

.qrcode-container {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.qrcode-container img {
    display: block;
}

.invoice-link-btn {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.invoice-link-btn:hover {
    background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.qrcode-preview {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #d9d9d9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px 15px;
    }

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

    .main-content {
        padding: 20px 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .result-item {
        flex-direction: column;
    }

    .result-item .label {
        width: auto;
        margin-bottom: 3px;
    }

    .form-group-half {
        width: 100%;
    }

    .toggle-btn {
        padding: 12px 15px;
    }
}
