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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

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

header h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 0;
}

.lang-switch-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* 语言切换开关样式 */
.switch {
  position: relative;
  margin: 0;
}

.switch input {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  z-index: 100;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.switch.demo3 {
  width: 180px;
  height: 50px;
}

.switch.demo3 label {
  display: block;
  width: 100%;
  height: 100%;
  background: #d8ba5f;
  border-radius: 50px;
  box-shadow: inset 0 4px 8px 2px rgba(248, 6, 6, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.3s;
}

.switch.demo3 label:after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -8px;
  border-radius: inherit;
  background: #ababab;
  background: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ababab));
  background: -webkit-linear-gradient(#f2f2f2, #ababab);
  background: linear-gradient(#f2f2f2, #ababab);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25);
}

.switch.demo3 label:before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -18px;
  right: -18px;
  bottom: -18px;
  left: -18px;
  border-radius: inherit;
  background: #eee;
  background: linear-gradient(#e5e7e6, #eee);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  filter: blur(1px);
}

.switch.demo3 label i {
  display: block;
  height: 100%;
  width: 60%;
  border-radius: inherit;
  background: silver;
  position: absolute;
  z-index: 2;
  right: 40%;
  top: 0;
  background: #b2ac9e;
  background: linear-gradient(#f7f2f6, #b2ac9e);
  box-shadow: inset 0 1px 0 white, 0 0 8px rgba(0, 0, 0, 0.3),
    0 5px 5px rgba(0, 0, 0, 0.2);
  transition: right 0.3s;
}

.switch.demo3 label i:after {
  content: "";
  position: absolute;
  left: 15%;
  top: 25%;
  width: 70%;
  height: 50%;
  background: #d2cbc3;
  background: linear-gradient(#cbc7bc, #d2cbc3);
  border-radius: inherit;
}

.switch.demo3 label i:before {
  content: "中文";
  text-transform: none;
  font-style: normal;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 #bcb8ae, 0 -1px 0 #97958e;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 18px;
  position: absolute;
  top: 50%;
  margin-top: -9px;
  right: -50%;
  transition: all 0.3s;
  white-space: nowrap;
}

.switch.demo3 input:checked ~ label {
  background: #9abb82;
}

.switch.demo3 input:checked ~ label i {
  right: -1%;
}

.switch.demo3 input:checked ~ label i:before {
  content: "EN";
  right: 115%;
  color: #82a06a;
  text-shadow: 0 1px 0 #afcb9b, 0 -1px 0 #111311;
  text-transform: uppercase;
}

.section {
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.admin-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.admin-status {
    margin-bottom: 10px;
    color: #555;
}

.admin-actions {
    text-align: right;
    margin-bottom: 10px;
}

.team-card {
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
}

.team-list .form-row,
.admin-passwords .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.team-list input,
.team-list textarea,
.admin-passwords input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.team-list label,
.admin-passwords label {
    color: #555;
    font-size: 14px;
}

/* 数据库统计 */
.stats-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.total-count {
    font-size: 20px;
}

.total-count .label {
    color: #666;
}

.total-count .value {
    color: #667eea;
    font-weight: 600;
    font-size: 28px;
    margin: 0 10px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-download {
    background: #f59e0b;
    color: white;
    margin-top: 15px;
}

.btn-download:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* 导入区域 */
.import-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.employee-selectors {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.selector {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.selector label {
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
}

.selector select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.file-name {
    color: #666;
    font-size: 14px;
}

.import-result {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.result-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.result-stats {
    flex: 0 0 250px;
}

.import-result h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.duplicate-details {
    flex: 1;
    min-width: 0;
}

.result-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
}

.result-item .label {
    color: #666;
    width: 120px;
}

.result-item .value {
    font-weight: 600;
    font-size: 20px;
    margin: 0 10px;
}

.result-item .value.duplicate {
    color: #ef4444;
}

.result-item .value.valid {
    color: #10b981;
}

.result-item .unit {
    color: #999;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.employee-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.sub-title {
    margin: 16px 0 8px;
    color: #333;
    font-weight: 600;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    animation: fadeIn 0.2s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

.toast.info { background: linear-gradient(120deg, #4f46e5, #667eea); }
.toast.error { background: linear-gradient(120deg, #ef4444, #f97316); }
.toast.success { background: linear-gradient(120deg, #10b981, #22c55e); }

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

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

.inline-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
}

.inline-dialog-content {
    background: linear-gradient(135deg, #5b67f1, #764ba2);
    color: #fff;
    padding: 20px 24px;
    border-radius: 14px;
    min-width: 280px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    text-align: center;
}

.inline-dialog-message {
    margin-bottom: 16px;
    font-size: 16px;
}

.btn-filter {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #e0e7ff;
    padding: 8px 14px;
    font-size: 14px;
}

.btn-filter.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.stats-table thead {
    background: #667eea;
    color: white;
}

.stats-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.stats-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

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

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

.loading {
    text-align: center;
    color: #999;
    padding: 30px !important;
}

/* 导出区域 */
.export-box {
    display: flex;
    gap: 15px;
}

/* 对话框 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dialog h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.dialog p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-box {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .file-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-box {
        flex-direction: column;
    }

    .dialog-buttons {
        flex-direction: column;
    }
    
    .result-container {
        flex-direction: column;
    }
    
    .result-stats {
        flex: 1;
        width: 100%;
    }
    
    .duplicate-details {
        width: 100%;
    }
    
    .employee-selectors {
        flex-direction: column;
    }
    
    .toast-container {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 20px;
    }
}

/* 文本输入区域 */
.text-import {
    margin-bottom: 20px;
}

.text-import label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.text-import label code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #667eea;
}

.phone-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

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

.phone-input::placeholder {
    color: #999;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
}

.input-count {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

.input-count span {
    color: #667eea;
    font-weight: 600;
}

/* 重复号码详情样式 */
.duplicate-details {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.duplicate-details h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.duplicate-section {
    margin-bottom: 15px;
}

.duplicate-section:last-child {
    margin-bottom: 0;
}

.duplicate-title {
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
}

.duplicate-list {
    background: white;
    border-radius: 6px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.duplicate-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
    flex-wrap: wrap;
}

.duplicate-item:last-child {
    margin-bottom: 0;
}

.duplicate-formatted {
    color: #667eea;
    font-weight: 600;
    margin-right: 8px;
}

.duplicate-imported {
    color: #ef4444;
    margin-right: 8px;
}

.duplicate-db {
    color: #10b981;
    margin-left: 8px;
}

.duplicate-originals {
    color: #666;
    margin-left: 8px;
}

.duplicate-arrow {
    color: #999;
    margin: 0 8px;
    font-size: 16px;
}

.duplicate-item code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: #333;
}
