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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 防止移动端双击缩放 */
    touch-action: manipulation;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.query-panel {
    padding: 40px 30px;
    background: #f8f9fa;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.select-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-input:hover {
    border-color: #667eea;
}

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

.query-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.query-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.query-button:active {
    transform: translateY(0);
}

.result-panel {
    padding: 30px;
    background: white;
}

.result-panel.hidden {
    display: none;
}

.result-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.result-header h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.result-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 6px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.result-content {
    color: #555;
    line-height: 1.8;
}

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

.method-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
}

.method-section h3::before {
    content: "▶";
    margin-right: 10px;
    color: #764ba2;
}

.method-section ul {
    list-style: none;
    padding-left: 0;
}

.method-section li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.method-section li:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.method-section li strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.warning-box strong {
    color: #856404;
}

.info-box {
    background: #d1ecf1;
    border-left: 4px solid #0dcaf0;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.info-box strong {
    color: #055160;
}

footer {
    padding: 20px 30px;
    background: #f8f9fa;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
}

.phone-query-box {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.phone-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.phone-select:hover {
    border-color: #667eea;
}

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

.phone-result a:hover {
    text-decoration: underline !important;
}

.conversation-demo-box {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.demo-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
}

.demo-scenarios {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.scenario-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.scenario-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.conversation-container {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.conversation-header {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.conversation-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.message {
    margin-bottom: 15px;
    animation: fadeInUp 0.5s ease;
}

.message-client {
    text-align: right;
}

.message-bank {
    text-align: left;
}

.message-speaker {
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.message-client .message-speaker {
    color: #667eea;
}

.message-bank .message-speaker {
    color: #764ba2;
}

.message-text {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 75%;
    word-wrap: break-word;
    line-height: 1.5;
}

.message-client .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: left;
}

.message-bank .message-text {
    background: #f0f0f0;
    color: #333;
}

.conversation-end {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.restart-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.talk-box {
    margin-top: 12px;
    padding: 12px;
    background: #fff7e6;
    border-left: 4px solid #ffb347;
    border-radius: 8px;
}

.talk-title {
    font-weight: 700;
    color: #d48806;
    margin-bottom: 8px;
}

.talk-content {
    color: #5c3c00;
    line-height: 1.6;
}

.video-box {
    margin-top: 14px;
    padding: 12px;
    background: #f0f7ff;
    border: 1px solid #e0ecff;
    border-radius: 10px;
}

.video-title {
    font-weight: 700;
    color: #315efb;
    margin-bottom: 8px;
}

.video-tip {
    margin-top: 8px;
    color: #4a5568;
    font-size: 0.95em;
}

.ai-consultation-panel {
    padding: 40px 30px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    border-radius: 15px;
    margin: 20px 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.lawyer-query-panel {
    padding: 30px;
    background: #f8f9fa;
    margin-top: 20px;
    border-radius: 10px;
}

.lawyer-ranking-intro {
    line-height: 1.6;
}

.lawyer-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lawyer-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.lawyer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.lawyer-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.lawyer-ranking-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    min-width: 70px;
    text-align: center;
}

.lawyer-city-badge {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    min-width: 70px;
    text-align: center;
}

.city-group {
    margin-top: 20px;
}

.lawyer-name {
    flex: 1;
    color: #333;
    font-size: 1.3em;
    margin: 0;
}

.lawyer-rating {
    color: #ffc107;
    font-weight: 600;
    font-size: 1.1em;
}

.lawyer-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    line-height: 1.6;
    color: #555;
}

.info-item strong {
    color: #333;
    margin-right: 8px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s;
}

/* AI咨询相关样式 */
.consultation-form {
    width: 100%;
}

.consultation-form textarea {
    font-family: inherit;
    font-size: 1em;
    line-height: 1.6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

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

.auth-form h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.logout-button {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 管理员后台退出按钮样式 - 确保可见 */
#adminLogoutBtn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999;
}

/* 债务管理面板 */
.debt-panel {
    padding: 20px;
    background: #f8f9fa;
}

.debt-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.debt-section h4 {
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.1em;
}

/* 债务输入表格样式 */
.debt-input-table {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

.debt-input-header {
    display: flex;
    background: #667eea;
    color: white;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    font-size: 0.9em;
}

.debt-input-cell {
    flex: 1;
    padding: 0 6px;
    text-align: center;
    font-size: 0.85em;
    min-width: 120px;
    line-height: 1.3;
}

.debt-input-cell:nth-child(1) {
    flex: 0.8;
    min-width: 100px;
}

.debt-input-cell:nth-child(2) {
    flex: 1.0;
    min-width: 120px;
}

.debt-input-cell:nth-child(3),
.debt-input-cell:nth-child(4),
.debt-input-cell:nth-child(5),
.debt-input-cell:nth-child(6),
.debt-input-cell:nth-child(7) {
    flex: 1.2;
    min-width: 140px;
}

.debt-input-cell:nth-child(8) {
    flex: 0.6;
    min-width: 80px;
}

.debt-input-rows {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: visible;
    position: relative;
    z-index: 1;
}

/* 确保下拉框不被父容器裁剪 */
.debt-input-rows:has(.bank-dropdown[style*="display: block"]) {
    overflow: visible;
}

.debt-input-row {
    display: flex;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    background: white;
    transition: background 0.2s;
    position: relative;
    z-index: 1;
    min-height: 50px;
}

.debt-input-row:has(.bank-dropdown[style*="display: block"]) {
    z-index: 1001 !important;
}

.debt-input-row:hover {
    background: #f8f9fa;
}

.debt-input-row:last-child {
    border-bottom: none;
}

.debt-input-field {
    flex: 1;
    padding: 0 6px;
    min-width: 120px;
    position: relative;
    overflow: visible;
}

.debt-input-field:nth-child(1) {
    flex: 0.8;
    min-width: 100px;
}

.debt-input-field:nth-child(2) {
    flex: 1.0;
    min-width: 120px;
    overflow: visible;
    z-index: 1000 !important;
}

.debt-input-field:nth-child(3),
.debt-input-field:nth-child(4),
.debt-input-field:nth-child(5),
.debt-input-field:nth-child(6),
.debt-input-field:nth-child(7) {
    flex: 1.2;
    min-width: 140px;
}

.debt-input-field:nth-child(8) {
    flex: 0.6;
    min-width: 80px;
    text-align: center;
}

.debt-input-field input,
.debt-input-field select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    transition: border-color 0.3s;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    box-sizing: border-box;
}

.debt-input-field input:focus,
.debt-input-field select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* 银行/平台下拉选择样式 */
.bank-select-wrapper {
    position: relative;
    width: 100%;
    z-index: 1000 !important;
}

.bank-dropdown {
    position: fixed !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 99999 !important;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
    display: none;
    min-width: 200px;
}

/* 模态框中的银行下拉框使用绝对定位 */
#bank-dropdown-modal {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 5px;
    max-height: 300px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.bank-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    user-select: none;
    pointer-events: auto;
    position: relative;
    z-index: 10001;
    line-height: 1.4;
}

.bank-dropdown-item:hover {
    background: #f8f9fa;
}

.bank-dropdown-item:last-child {
    border-bottom: none;
}

.bank-dropdown-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.bank-dropdown-item-phone {
    font-size: 0.85em;
    color: #667eea;
}

.bank-dropdown-item-note {
    font-size: 0.8em;
    color: #666;
    margin-top: 3px;
}

.debt-input-field .delete-row-btn {
    padding: 5px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.2s;
}

.debt-input-field .delete-row-btn:hover {
    background: #c82333;
}

.debt-input-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 0;
}

.income-input-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 收入信息表单组（移动端优化） */
.income-form-group {
    flex: 1;
    min-width: 0; /* 允许缩小 */
}

.income-form-group label {
    font-size: 0.9em !important; /* 缩小标签字体 */
    margin-bottom: 5px;
}

.income-form-group .select-input {
    font-size: 0.9em !important; /* 缩小输入框字体 */
    padding: 8px 12px;
}

/* 微信联系浮动按钮 */
.wechat-contact-btn {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wechat-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.wechat-contact-btn:active {
    transform: scale(0.95);
}

/* 债务表单模态框样式 */
.debt-form-modal .form-group {
    margin-bottom: 15px;
}

.debt-form-modal .form-group label {
    font-size: 0.95em;
    margin-bottom: 8px;
}

.debt-form-modal .select-input {
    font-size: 0.95em;
    padding: 10px 12px;
}

.debt-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.debt-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debt-item-info {
    flex: 1;
}

.debt-item-info strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.debt-item-info span {
    color: #666;
    font-size: 0.9em;
    margin-right: 15px;
}

.debt-item-actions {
    display: flex;
    gap: 10px;
}

.delete-debt-btn {
    padding: 5px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.delete-debt-btn:hover {
    background: #c82333;
}

.close-button {
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.close-button:hover {
    background: #c82333;
}

.report-summary {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.report-summary h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
}

.recommendation-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.recommendation-item.urgent {
    background: #fff3cd;
    border-color: #ffc107;
}

.recommendation-item.important {
    background: #d1ecf1;
    border-color: #0dcaf0;
}

.recommendation-item.warning {
    background: #f8d7da;
    border-color: #dc3545;
}

.recommendation-item.info {
    background: #d4edda;
    border-color: #28a745;
}

.recommendation-item h4 {
    margin-bottom: 8px;
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 - 平板和手机 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
        margin: 0;
    }
    
    header {
        padding: 25px 20px;
    }
    
    header h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    /* 用户信息区域 */
    #userInfo {
        text-align: left !important;
        margin-top: 15px !important;
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    #userName {
        margin-right: 0 !important;
        margin-bottom: 5px;
        font-size: 0.9em;
    }
    
    #logoutBtn {
        width: 100%;
        padding: 10px;
        font-size: 0.9em;
    }
    
    #loginPrompt {
        margin-top: 15px !important;
    }
    
    #loginPrompt .query-button {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* 联系信息区域 */
    header > div:last-child {
        padding: 12px !important;
        margin-top: 15px !important;
    }
    
    header > div:last-child p {
        font-size: 0.85em !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    header > div:last-child img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .query-panel,
    .result-panel,
    .lawyer-query-panel,
    .ai-consultation-panel,
    .debt-panel {
        padding: 20px 15px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 0.95em;
        margin-bottom: 8px;
    }
    
    .select-input,
    .query-button {
        font-size: 1em;
        padding: 12px 15px;
        min-height: 44px; /* 确保触摸友好 */
    }
    
    .query-button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .lawyer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lawyer-name {
        font-size: 1.1em;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        padding: 20px 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content h2 {
        font-size: 1.5em;
    }
    
    .debt-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .debt-item-actions {
        width: 100%;
        margin-top: 10px;
    }
    
    /* 债务输入表格 - 移动端优化 */
    .debt-input-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .debt-input-header {
        font-size: 0.7em;
        padding: 6px 8px;
        min-width: 900px; /* 确保表格可以横向滚动 */
        white-space: nowrap;
    }
    
    .debt-input-cell {
        font-size: 0.7em;
        padding: 0 4px;
        min-width: 100px;
        white-space: nowrap;
    }
    
    .debt-input-row {
        min-width: 900px; /* 确保表格可以横向滚动 */
        padding: 6px 8px;
    }
    
    .debt-input-field {
        min-width: 100px;
    }
    
    .debt-input-field input,
    .debt-input-field select {
        font-size: 0.75em;
        padding: 6px 8px;
        min-height: 36px;
        width: 100%;
    }
    
    .debt-input-rows {
        max-height: 400px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .debt-input-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .debt-input-actions .query-button {
        width: 100%;
        margin-right: 0;
    }
    
    /* 银行下拉框在移动端 */
    .bank-dropdown {
        max-height: 150px;
        font-size: 0.85em;
    }
    
    .bank-dropdown-item {
        padding: 10px 12px;
    }
    
    /* 管理员后台 */
    .admin-panel {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .admin-header h2 {
        font-size: 1.5em;
    }
    
    .admin-header .logout-button {
        width: 100%;
        padding: 12px;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .admin-tab {
        flex: 1;
        min-width: 120px;
        font-size: 0.9em;
        padding: 10px 15px;
    }
    
    /* 表格响应式 */
    .admin-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 15px 0;
    }
    
    .admin-table table {
        min-width: 900px;
        font-size: 0.85em;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
        font-size: 0.85em;
    }
    
    /* 充值选项 */
    .recharge-option {
        min-width: 120px;
        padding: 15px;
        font-size: 0.9em;
    }
    
    .payment-option {
        min-width: 100px;
        padding: 12px;
        font-size: 0.85em;
    }
    
    /* 结果内容 */
    .result-content {
        font-size: 0.95em;
        line-height: 1.6;
    }
    
    .method-section {
        margin-bottom: 20px;
    }
    
    .method-section h3 {
        font-size: 1.2em;
    }
    
    .method-section ul {
        padding-left: 20px;
    }
    
    .method-section li {
        margin-bottom: 10px;
    }
    
    /* 律师事务所卡片 */
    .lawyer-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .lawyer-name {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .lawyer-info {
        font-size: 0.9em;
    }
    
    /* 关闭按钮 */
    .close {
        font-size: 28px;
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
    
    /* 收入信息表单 */
    .income-form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .income-form .form-group {
        margin-bottom: 0;
    }
    
    /* 收入信息移动端优化 */
    .income-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .income-form-group {
        flex: 1;
        width: 100%;
        margin-right: 0 !important;
    }
    
    .income-form-group label {
        font-size: 0.85em !important;
        margin-bottom: 5px;
    }
    
    .income-form-group .select-input {
        font-size: 0.85em !important;
        padding: 8px 10px;
    }
    
    /* 微信联系按钮移动端位置调整 */
    .wechat-contact-btn {
        right: 15px;
        bottom: 70px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    #userInfo {
        margin-top: 12px !important;
    }
    
    #userName {
        font-size: 0.85em;
    }
    
    #logoutBtn {
        padding: 10px;
        font-size: 0.85em;
    }
    
    header > div:last-child {
        padding: 10px !important;
    }
    
    header > div:last-child p {
        font-size: 0.8em !important;
    }
    
    header > div:last-child img {
        width: 45px !important;
        height: 45px !important;
    }
    
    /* 收入信息小屏幕进一步优化 */
    .income-form-group label {
        font-size: 0.8em !important;
    }
    
    .income-form-group .select-input {
        font-size: 0.8em !important;
        padding: 6px 8px;
    }
    
    .query-panel,
    .result-panel,
    .lawyer-query-panel,
    .ai-consultation-panel,
    .debt-panel {
        padding: 15px 10px;
    }
    
    .modal-content {
        width: 98%;
        padding: 15px 10px;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .modal-content h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.95em;
        margin-bottom: 8px;
    }
    
    .select-input,
    .query-button {
        font-size: 0.95em;
        padding: 10px 12px;
        min-height: 44px;
    }
    
    /* 债务输入表格 - 小屏幕 */
    .debt-input-header {
        font-size: 0.65em;
        padding: 5px 6px;
        min-width: 900px;
    }
    
    .debt-input-cell {
        font-size: 0.65em;
        padding: 0 3px;
        min-width: 90px;
    }
    
    .debt-input-row {
        padding: 5px 6px;
        min-width: 900px;
    }
    
    .debt-input-field input,
    .debt-input-field select {
        font-size: 0.7em;
        padding: 5px 6px;
        min-height: 32px;
    }
    
    .debt-input-rows {
        max-height: 350px;
    }
    
    /* 按钮组 */
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group .query-button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* 结果面板 */
    .result-content {
        font-size: 0.9em;
        line-height: 1.6;
    }
    
    .method-section {
        margin-bottom: 18px;
    }
    
    .method-section h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .method-section ul {
        padding-left: 18px;
    }
    
    .method-section li {
        margin-bottom: 8px;
    }
    
    /* 律师事务所卡片 */
    .lawyer-card {
        padding: 12px;
    }
    
    .lawyer-name {
        font-size: 1em;
    }
    
    .lawyer-info {
        font-size: 0.85em;
    }
    
    /* 管理员表格 */
    .admin-table table {
        font-size: 0.75em;
        min-width: 800px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 6px 4px;
    }
    
    /* 充值选项 */
    .recharge-option {
        min-width: 100px;
        padding: 12px;
        font-size: 0.85em;
    }
    
    .recharge-option > div:first-child {
        font-size: 1.3em;
    }
    
    .payment-option {
        min-width: 80px;
        padding: 10px;
        font-size: 0.8em;
    }
    
    /* 标签 */
    .tag {
        font-size: 0.8em;
        padding: 5px 12px;
    }
    
    /* 警告框 */
    .warning-box,
    .info-box {
        padding: 12px;
        font-size: 0.9em;
    }
    
    /* 关闭按钮 */
    .close {
        font-size: 24px;
        width: 32px;
        height: 32px;
        line-height: 32px;
        top: 10px;
        right: 10px;
    }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
        margin: 2% auto;
        padding: 15px;
    }
    
    .debt-input-rows {
        max-height: 300px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.6em;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .query-button,
    .select-input,
    .debt-input-field input,
    .debt-input-field select {
        min-height: 44px;
    }
    
    /* 移除hover效果，使用active */
    .query-button:hover {
        transform: none;
    }
    
    .query-button:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* 确保链接和按钮有足够的点击区域 */
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .query-button,
    .select-input {
        border-width: 1.5px;
    }
}

/* 模板相关样式 */
.templates-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.template-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.template-btn:active {
    transform: translateY(0);
}

#templateContent {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 充值相关样式 */
.recharge-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.payment-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.recharge-option.selected,
.payment-option.selected {
    border-color: #667eea !important;
    background-color: #f0f4ff !important;
}

#qrCodeSection img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* 管理员后台样式 */
.admin-panel {
    max-width: 1400px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.admin-header h2 {
    color: #667eea;
    margin: 0;
}

.admin-header .logout-button {
    padding: 10px 25px;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.admin-header .logout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.admin-tab {
    padding: 12px 24px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    transition: all 0.3s;
}

.admin-tab:hover {
    background: #e9ecef;
}

.admin-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.admin-tab-content {
    display: none;
}

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

.admin-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
    font-weight: 600;
    font-size: 0.95em;
}

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

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 5px;
    transition: all 0.3s;
}

.admin-btn-view {
    background: #667eea;
    color: white;
}

.admin-btn-view:hover {
    background: #5568d3;
}

.admin-btn-delete {
    background: #dc3545;
    color: white;
}

.admin-btn-delete:hover {
    background: #c82333;
}

.user-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.user-detail-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.user-detail-content h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.user-detail-content h4 {
    color: #764ba2;
    margin-top: 20px;
    margin-bottom: 10px;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-item h4 {
    margin: 0 0 10px 0;
    font-size: 0.95em;
    opacity: 0.9;
}

.stat-item p {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}
