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

body {
    font-family: 'Arial', sans-serif;
    background: #f0f2f5;
    padding: 20px;
    background-color: #ffffff;
    transition: background-color 3s ease;
}

.container {
    max-width: 100%;
    text-align: center;
    transition: filter 0.5s ease;
    min-height: 58vh;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.card-type-selector {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.card-type-selector label {
    font-size: 1rem;
    color: #333;
    cursor: pointer;
}

.card-type-selector input[type="radio"] {
    margin-right: 5px;
}

button {
    background: #ff9547;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
}

button:hover {
    background: #a86330;
}

#status {
    margin: 15px 0;
    font-size: 1rem;
    color: #555;
    min-height: 24px;
}

#cameraContainer {
    position: relative;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
}

#video {
    width: 100%;
    max-height: 70vh;
    background: #000;
    border-radius: 10px;
}

.scan-frame {
    width: 80%;
    aspect-ratio: 350 / 488; /* 宽:高 = 350:488 → 竖向框 */
    max-height: 90%;         /* 防止超出画面 */
    /*border: 3px dashed #00ff00;*/
    /*border-radius: 10px;*/
    position: relative;
    background: rgba(0, 255, 0, 0.03);
    margin: auto;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.hint {
    position: absolute;
    left: -20%;
    top: 50%;
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.hint-sub {
    color: #ccffcc;
    font-size: 14px;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.hidden {
    display: none !important;
}

#playButton {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
    display: none;
}

#playButton:hover {
    background: #218838;
}

#playButton.active {
    display: inline-block !important; /* 强制显示 */
}

.footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 0.875rem;
    color: #666;
    width: 100%;
    box-sizing: border-box;
}

.hidden {
    display: none;
}

/* ——— 首次横屏提示覆盖层与模糊 ——— */
.container.blur-active {
    filter: blur(8px);
}

.orientation-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.orientation-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.orientation-text {
    color: #000;
    font-size: 1.2rem;
    font-weight: bold;
    /* 初始不旋转，激活后执行动画 */
    transform: rotate(0deg);
    transform-origin: center center;
    margin-bottom: 24px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* 覆盖层激活时，文字在 0.5s 内逆时针旋转 90° */
.orientation-overlay.active .orientation-text {
    animation: rotateToCCW90 0.5s ease forwards;
}

@keyframes rotateToCCW90 {
    from { transform: rotate(0deg); }
    to { transform: rotate(90deg); }
}

.orientation-confirm {
    /* 复用按钮风格，稍作放大 */
    padding: 14px 28px;
    /* 覆盖层不旋转，按钮保持正常方向 */
}

/* 强化按钮旋转（提高优先级与兼容性） */
#orientationConfirm {
    display: inline-block;
    position: absolute;
    left: 35vw; /* 保持你当前微调位置 */
    top: 47vh;  /* 保持你当前微调位置 */
    transform: translate(-50%, -50%) rotate(90deg) !important;
    -webkit-transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center;
    -webkit-transform-origin: center center;
    margin: 0 !important;
    /* 初始隐藏，待文字旋转完成后再显示 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.orientation-overlay.active.show-confirm #orientationConfirm {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#cardImage {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    border-radius: 8px;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.beta-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #ff9547;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px; /* 圆角矩形 */
    line-height: 1;
    margin-top: 4em;
}

.short-hr {
    border: none;
    border-top: 1px solid #333;
    width: 100px;
    margin: 4em auto -1.6em auto;
}

/* —— 历史记录小窗 —— */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.modal-dialog {
    width: min(85vw, 420px);
    max-height: 70vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1rem;
    font-weight: bold;
}

.modal-close {
    background: transparent;
    color: #333;
    font-size: 20px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.modal-content {
    padding: 8px 0 12px 0;
    overflow: auto;
}

.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-list li {
    border-bottom: 1px solid #f2f2f2;
}

.history-list button {
    width: 100%;
    background: transparent;
    color: #333;
    text-align: left;
    padding: 10px 16px;
    border-radius: 0;
    margin: 0;
}

.history-list button:hover {
    background: #fafafa;
}

.history-empty {
    color: #888;
    font-size: 0.95rem;
    padding: 16px;
    text-align: center;
}

.ipv6-ssl-logo {
    filter: hue-rotate(245deg) brightness(1.08) saturate(1.2);
}

.modern-footer {
  width: 100%;
  padding: 3rem 1rem;
  background-color: var(--bg-color); /* 如果想透明可以去掉这行 */
  color: var(--text-gray);
  font-size: 0.875rem;
  line-height: 1.6;
  border-top: 1px solid rgba(0,0,0,0.05); /* 顶部加条淡淡的线，增加精致感 */
  margin-top: 30px;
  border-radius: 12px 12px 0 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem; /* 模块之间的间距 */
  text-align: center;
}

/* --- 链接通用样式 --- */
a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* 高亮链接样式 */
.highlight-link {
  color: var(--mikan-orange);
  font-weight: bold;
  position: relative;
}

/* 鼠标悬停时的小下划线动效 */
.highlight-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--mikan-orange);
  transition: width 0.3s;
}

.highlight-link:hover::after {
  width: 100%;
}

:root {
  --mikan-orange: #ff9547;
  --mikan-deep-orange: #ff7b29; /* 深一点的颜色，用于渐变或按压 */
  --btn-shadow: rgba(255, 149, 71, 0.4); /* 专属的橙色光晕 */
}

/* --- 文本微调 --- */
.sub-text {
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0.2rem 0;
}

.credit-text {
  font-weight: 500;
}

/* --- ICP 模块 --- */
.icp-group {
  display: flex;
  flex-wrap: wrap; /* 手机上自动换行 */
  justify-content: center;
  gap: 1.5rem;
  align-items: center;
}

.icp-item {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* 图标和文字的间距 */
}

.icp-item img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.icp-item a:hover {
  color: var(--mikan-orange);
}

/* --- 徽章模块 --- */
.badges-group {
  display: flex;
  gap: 1rem;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.badges-group:hover {
  opacity: 1;
}

.badges-group img {
  height: 32px; /* 统一高度，视觉更整齐 */
  width: auto;
  border-radius: 4px; /* 稍微圆角一点点 */
  transition: transform 0.2s;
}

.badges-group img:hover {
  transform: scale(1.05); /* 鼠标放上去微微放大 */
}

/* --- 移动端适配 --- */
@media (max-width: 600px) {
  .icp-group {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.mikan-btn {
  /* --- 基础颜值 --- */
  background: linear-gradient(135deg, var(--mikan-orange), var(--mikan-deep-orange)); /* 微渐变，质感直接拉满 */
  color: white;
  border: none;
  padding: 12px 28px; /* 稍微宽一点，大气 */
  font-size: 1rem;
  font-weight: 600; /* 字体加粗一点，更有精神 */
  border-radius: 50px; /* 全圆角（Pill shape）比 8px 看起来更亲切、更现代 */
  cursor: pointer;
  margin-bottom: 20px;
  
  /* --- 搞点特效 --- */
  box-shadow: 0 4px 15px var(--btn-shadow); /* 这一点点投影是“悬浮感”的关键 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* 丝滑过渡，拒绝僵硬 */
  
  /* --- 防止文字被选中 --- */
  user-select: none;
  
  /* --- 如果按钮里有图标，这行能自动居中 --- */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* --- 鼠标移上去：起飞！ --- */
.mikan-btn:hover {
  transform: translateY(-2px); /* 微微上浮，暗示“快点我” */
  box-shadow: 0 8px 20px var(--btn-shadow); /* 投影变大，光感增强 */
  background: linear-gradient(135deg, #ffa360, #ff853a); /* 稍微变亮一点点 */
}

/* --- 鼠标按下去：Q弹反馈 --- */
.mikan-btn:active {
  transform: translateY(1px) scale(0.98); /* 微微下沉 + 缩小，模仿按压真实物体的感觉 */
  box-shadow: 0 2px 10px var(--btn-shadow); /* 投影收缩 */
}

/* --- 禁用状态 (虽然你没要，但专业的按钮必须得有) --- */
.mikan-btn:disabled {
  background: #e0e0e0;
  color: #a8a8a8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}