:root {
  --primary: #1890FF;
  --primary-dark: #096DD9;
  --success: #52C41A;
  --error: #FF4D4F;
  --background: #F0F2F5;
  --card-bg: #FFFFFF;
  --text: #000000;
  --text-secondary: #697B8C;
  --border: #D9D9D9;
  --shadow: rgba(0, 0, 0, 0.1);
}

.dark-mode {
  --primary: #1890FF;
  --primary-dark: #096DD9;
  --background: #141414;
  --card-bg: #1F1F1F;
  --text: #FFFFFF;
  --text-secondary: #A6A7AB;
  --border: #434343;
  --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Noto Sans SC', 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header Styles */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px var(--shadow);
  margin-bottom: 2rem;
}

.header-content {
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 600;
}

.tab-navigation {
  display: flex;
  gap: 0.5rem;
  background: var(--background);
  padding: 0.25rem;
  border-radius: 0.75rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.tab-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: 0 1px 3px var(--shadow);
}

/* Main Content Styles */
main {
  padding: 2rem 0;
}

.section {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.section.active {
  display: block;
}

.card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px var(--shadow);
  margin-bottom: 1.5rem;
}

.main-card {
  max-width: 800px;
  margin: 0 auto 2rem;
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-header h2 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
}

input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--text);
  transition: all 0.2s;
  font-size: 0.9rem;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.helper-text {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Verification Code Styles */
.code-input-group {
  margin-bottom: 1.5rem;
}

.code-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.code-input-wrapper input {
  width: 150px;
}

.code-image {
  height: 40px;
  border-radius: 0.25rem;
  cursor: pointer;
}

.refresh-btn {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Button Styles */
.button-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

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

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

.btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

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

/* Info Cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.info-card {
  text-align: center;
  padding: 2rem;
}

.info-card .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.info-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 1rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* 查询结果样式 */
.area-results {
  padding: 1rem;
}

.result-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.result-header h3 {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 600;
}

.result-section {
  margin-top: 2rem;
  border-top: 1px dashed var(--border);
  padding-top: 1.5rem;
}

.result-section h4 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

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

.result-item .value {
  color: var(--text);
  font-weight: 500;
}

/* 加载状态样式 */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(24, 144, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* 错误信息样式 */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.error-icon {
  font-size: 2.5rem;
  color: var(--error);
  margin-bottom: 1rem;
}

.error-title {
  color: var(--error);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.error-message p {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.error-code {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Footer Styles */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--primary);
}

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

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 身份证号码结构解析样式 */
.id-card-container {
  max-width: 800px;
  margin: 0 auto 2rem;
  position: relative;
  overflow: hidden;
}

/* 卡片标题样式 */
.card-header.with-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-bottom: 1.5rem;
}

.header-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 身份证号码示意图 */
.id-visual {
  margin: 2rem 0;
  position: relative;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 1rem;
  box-shadow: inset 0 0 10px var(--shadow);
  text-align: center;
}

.id-number-visual {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.5rem 1rem 1rem;
  background: var(--background);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.id-segment-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.id-segment {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  letter-spacing: 1px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 0.75rem;
}

.id-segment:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0.5rem;
  border: 3px solid transparent;
  transition: all 0.3s;
  z-index: -1;
}

.id-segment:hover {
  transform: scale(1.2) translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.id-segment:hover:after {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(24, 144, 255, 0.3);
}

/* 激活状态样式 */
.id-segment.active {
  transform: scale(1.2) translateY(-5px) !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25) !important;
  z-index: 5;
}

.id-segment.active:after {
  border-color: var(--primary);
  border-width: 3px;
  box-shadow: 0 0 0 6px rgba(24, 144, 255, 0.4);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(24, 144, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0); }
}

.id-segment.area-code {
  background: rgba(24, 144, 255, 0.15);
  color: var(--primary-dark);
}

.id-segment.birth-date {
  background: rgba(82, 196, 26, 0.15);
  color: #389e0d;
}

.id-segment.sequence {
  background: rgba(250, 173, 20, 0.15);
  color: #d48806;
}

.id-segment.checksum {
  background: rgba(245, 34, 45, 0.15);
  color: #cf1322;
}

.id-arrow {
  position: relative;
  width: 2px;
  background-color: var(--primary);
  height: 20px;
  margin: 0 auto;
  opacity: 0.6;
}

.id-arrow:before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--primary);
  transition: all 0.3s ease;
}

.id-arrow:after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  transform: scale(0);
  transition: transform 0.3s ease;
  opacity: 0.7;
}

/* 箭头激活状态 */
.id-arrow[data-part="area"].active, 
.id-segment.area-code:hover + .id-arrow[data-part="area"],
.id-part[data-part="area"]:hover ~ .id-number-visual .id-arrow[data-part="area"] {
  background-color: var(--primary);
  height: 25px;
  opacity: 1;
  box-shadow: 0 0 5px rgba(24, 144, 255, 0.5);
}

.id-arrow[data-part="area"].active:before, 
.id-segment.area-code:hover + .id-arrow[data-part="area"]:before,
.id-part[data-part="area"]:hover ~ .id-number-visual .id-arrow[data-part="area"]:before {
  border-top-color: var(--primary);
  transform: scale(1.1);
}

.id-arrow[data-part="area"].active:after, 
.id-segment.area-code:hover + .id-arrow[data-part="area"]:after,
.id-part[data-part="area"]:hover ~ .id-number-visual .id-arrow[data-part="area"]:after {
  transform: scale(1);
  animation: pulse 1.5s infinite;
}

/* 出生日期箭头 */
.id-arrow[data-part="birth"].active, 
.id-segment.birth-date:hover + .id-arrow[data-part="birth"],
.id-part[data-part="birth"]:hover ~ .id-number-visual .id-arrow[data-part="birth"] {
  background-color: #52C41A;
  height: 25px;
  opacity: 1;
  box-shadow: 0 0 5px rgba(82, 196, 26, 0.5);
}

.id-arrow[data-part="birth"].active:before, 
.id-segment.birth-date:hover + .id-arrow[data-part="birth"]:before,
.id-part[data-part="birth"]:hover ~ .id-number-visual .id-arrow[data-part="birth"]:before {
  border-top-color: #52C41A;
  transform: scale(1.1);
}

.id-arrow[data-part="birth"].active:after, 
.id-segment.birth-date:hover + .id-arrow[data-part="birth"]:after,
.id-part[data-part="birth"]:hover ~ .id-number-visual .id-arrow[data-part="birth"]:after {
  background-color: #52C41A;
  transform: scale(1);
  animation: pulse 1.5s infinite;
}

/* 顺序码箭头 */
.id-arrow[data-part="seq"].active, 
.id-segment.sequence:hover + .id-arrow[data-part="seq"],
.id-part[data-part="seq"]:hover ~ .id-number-visual .id-arrow[data-part="seq"] {
  background-color: #FAAD14;
  height: 25px;
  opacity: 1;
  box-shadow: 0 0 5px rgba(250, 173, 20, 0.5);
}

.id-arrow[data-part="seq"].active:before, 
.id-segment.sequence:hover + .id-arrow[data-part="seq"]:before,
.id-part[data-part="seq"]:hover ~ .id-number-visual .id-arrow[data-part="seq"]:before {
  border-top-color: #FAAD14;
  transform: scale(1.1);
}

.id-arrow[data-part="seq"].active:after, 
.id-segment.sequence:hover + .id-arrow[data-part="seq"]:after,
.id-part[data-part="seq"]:hover ~ .id-number-visual .id-arrow[data-part="seq"]:after {
  background-color: #FAAD14;
  transform: scale(1);
  animation: pulse 1.5s infinite;
}

/* 校验码箭头 */
.id-arrow[data-part="check"].active, 
.id-segment.checksum:hover + .id-arrow[data-part="check"],
.id-part[data-part="check"]:hover ~ .id-number-visual .id-arrow[data-part="check"] {
  background-color: #FF4D4F;
  height: 25px;
  opacity: 1;
  box-shadow: 0 0 5px rgba(255, 77, 79, 0.5);
}

.id-arrow[data-part="check"].active:before, 
.id-segment.checksum:hover + .id-arrow[data-part="check"]:before,
.id-part[data-part="check"]:hover ~ .id-number-visual .id-arrow[data-part="check"]:before {
  border-top-color: #FF4D4F;
  transform: scale(1.1);
}

.id-arrow[data-part="check"].active:after, 
.id-segment.checksum:hover + .id-arrow[data-part="check"]:after,
.id-part[data-part="check"]:hover ~ .id-number-visual .id-arrow[data-part="check"]:after {
  background-color: #FF4D4F;
  transform: scale(1);
  animation: pulse 1.5s infinite;
}

/* 身份证号码结构详解 */
.id-structure {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.id-part {
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.id-part:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.7;
}

.id-structure {
  margin: 2.5rem 0;
}

.id-part {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  border: 2px solid var(--border);
  transform-origin: center;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.id-part:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  opacity: 0.7;
  transition: all 0.4s ease;
}

.id-part:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.15) 0%, rgba(24, 144, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.id-part:hover, .id-part.active {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 15px 30px var(--shadow);
  border-color: var(--primary);
  z-index: 10;
}

.id-part:hover:after, .id-part.active:after {
  opacity: 1;
}

.id-part.active:before, .id-part:hover:before {
  opacity: 1;
  width: 10px;
}

.id-part:hover .id-label, .id-part.active .id-label {
  color: var(--primary);
  font-size: 1.2rem;
  transform: translateX(5px);
}

.id-part:hover .id-digits, .id-part.active .id-digits {
  background: rgba(24, 144, 255, 0.2);
  transform: scale(1.1);
}

.id-part:hover .id-desc, .id-part.active .id-desc {
  color: var(--text);
}

.id-part:hover .highlight, .id-part.active .highlight {
  color: #096DD9;
  font-weight: 700;
}

/* 添加动画效果 */
.id-part.active {
  animation: highlight-pulse 2s infinite;
}

@keyframes highlight-pulse {
  0% { box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
  50% { box-shadow: 0 15px 40px rgba(24, 144, 255, 0.4); }
  100% { box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
}

.id-part[data-part="area"]:before { background: var(--primary); }
.id-part[data-part="birth"]:before { background: #52C41A; }
.id-part[data-part="seq"]:before { background: #FAAD14; }
.id-part[data-part="check"]:before { background: #FF4D4F; }

.id-part-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

.id-label {
  font-weight: 600;
  color: var(--text);
  font-size: 1.1rem;
}

.id-digits {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.85rem;
  background: var(--background);
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.id-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.id-example-small {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  padding: 0.5rem;
  background: var(--background);
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary);
}

.highlight {
  color: var(--primary);
  font-weight: 500;
  padding: 0 0.25rem;
  position: relative;
}

.highlight:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(24, 144, 255, 0.2);
  border-radius: 2px;
}

/* 小知识提示区 */
.id-tips {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 0.75rem;
  border: 1px dashed var(--border);
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.tip-content {
  flex: 1;
}

.tip-content h4 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1.1rem;
}

.tip-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tab-navigation {
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .footer .container {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .info-cards {
    grid-template-columns: 1fr;
  }
}