@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,700|Quattrocento:700');

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei";
    font-weight: normal;
    background: white;
    overflow: hidden;
}

@media screen and (prefers-reduced-motion: no-preference) {
    body.switched {
        transition: color 0.6s, background-color 0.6s;
    }
}

h1,
h2 {
    text-align: center;
    font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei";
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 30pt;
    margin-bottom: 10px;
}

h2 {
    font-size: 14pt;
    font-style: italic;
    font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei";
    font-weight: lighter;
    color: #BBB;
}

.header {
    padding-top: 3em;
    padding-bottom: 3em;
}

/*
  Built-in class:
    # author: Name
*/
.byline {
    font-style: italic;
}

.written-in-ink {
    z-index: 3;
    font-size: 9pt;
    font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei";
    text-align: center;
    font-weight: 700;
    position: fixed;
    display: block;
    width: 100%;
    background: white;
    margin: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    height: 14px;
    top: 0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .written-in-ink {
        transition: color 0.6s, background 0.6s;
    }
}

/* 
  Enables <iframe> support work on itch.io when using mobile iOS
*/
.outerContainer {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow: scroll;
    overflow-x: hidden;
    height: 95%;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 24px;
background-image: url('background1.jpg') ;
    background-size: cover;
    background-repeat: no-repeat;
}

@media screen and (max-width: 980px) {
    .outerContainer {
        margin-top: 44px;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

.container {
    display: block;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 4em;
    background: white; 
}

@media screen and (prefers-reduced-motion: no-preference) {
    .switched .container {
        transition: background-color 0.6s;
    }
}

p {
    font-size: 13pt;
    color: #333;
    line-height: 1.7em;
    font-weight: normal;
}

a {
    font-weight: 700;
    color: #b97c2c;
    font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei";
    text-decoration: none;
}

.unclickable {
    font-weight: 700;
    color: #4f3411;
    font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei";
    text-decoration: none;
    cursor: not-allowed;
}

a:hover {
    color: black;
}

@media screen and (prefers-reduced-motion: no-preference) {
    a {
        transition: color 0.6s;
    }

    a:hover {
        transition: color 0.1s;
    }
}

strong {
    color: black;
    font-weight: bold;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.container .hide {
    opacity: 0.0;
}

.container .invisible {
    display: none;
}

.container>* {
    opacity: 1.0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .container>* {
        transition: opacity 1.0s;
    }
}

/*
  Class applied to all choices
  (Will always appear inside <p> element by default.)
*/
.choice {
    text-align: center;
    line-height: 1.7em;
}

/* 
  Class applied to first choice
*/
:not(.choice)+.choice {
    padding-top: 1em;
}

/*
  Class applied to choice links
*/
.choice a, .choice span {
    font-size: 15pt;
}

/* 
  Built-in class:
    The End # CLASS: end
*/
.end {
    text-align: center;
    font-weight: bold;
    color: black;
    padding-top: 20px;
    padding-bottom: 20px;
}

#controls {
    z-index: 4;
    font-size: 9pt;
    text-align: center;
    padding-bottom: 6px;
    position: fixed;
    right: 20px;
    top: 4px;
    -webkit-user-select: none;
    user-select: none;
    /*background: white;*/ 
}

@media screen and (prefers-reduced-motion: no-preference) {
    #controls {
        transition: color 0.6s, background 0.6s;
    }
}

#controls [disabled] {
    color: #ccc;
}

#controls>*:not(:last-child):after {
    content: " | ";
}

@media screen and (max-width: 980px) {
    #controls {
        z-index: 2;
        padding-top: 24px;
        top: 0;
        left: 0;
        right: 0;
    }
}

/* 
  Dark Theme (Added in Inky 0.10.0)
    # theme: dark
*/

body.dark {
    background: black;
    color: white;
}

.dark h2 {
    color: #666;
}

.dark .container {
    background: black;
}

.dark .written-in-ink {
    background: black;
}

.dark a {
    color: #cc8f1a;
}
.dark .unclickable{
    color: #c4af87;
    cursor:not-allowed;
}

.dark a:hover {
    color: white;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .dark a {
        transition: color 0.6s;
    }
}

.dark strong {
    color: white;
}

.dark #controls [disabled] {
    color: #444;
}

.dark .end {
    color: white;
}

.dark #controls {
    background: black;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    background-color: white;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: transform 0.2s ease-out;
}

.dark .modal-container {
    background-color: #222;
    color: white;
}

.modal-overlay.hidden .modal-container {
    transform: translateY(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
    color: #666;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #000;
}

.dark .close-button {
    color: #999;
}

.dark .close-button:hover {
    color: #fff;
}

/* 添加点击效果 */
.close-button:active {
    transform: scale(0.95);
}

/* 移除按钮的默认外观 */
.close-button:focus {
    outline: none;
}

/* 可选: 添加键盘焦点样式 */
.close-button:focus-visible {
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.5);
    border-radius: 4px;
}

.slot-list {
    overflow-y: auto;
    max-height: calc(80vh - 100px);
    padding-right: 10px;
}

.save-slot {
    display: flex;
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 8px;
    border-radius: 4px;
    align-items: center;
}

.save-slot:hover {
    background-color: #f5f5f5;
    transform: translateX(5px);
}

.save-slot .number {
    width: 60px;
    font-weight: bold;
    color: #666;
}

.save-slot .content {
    flex-grow: 1;
    font-size: 14px;
}

.save-slot .time {
    width: 150px;
    text-align: right;
    color: #888;
    font-size: 12px;
}

.empty-slot {
    color: #999;
    background-color: #fafafa;
}

.empty-slot:hover {
    background-color: #f0f0f0;
}

/* 自定义滚动条样式 */
.save-list::-webkit-scrollbar {
    width: 8px;
}

.save-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.save-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.save-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.new-save {
    border: 2px dashed #ccc;
    background-color: #f9f9f9;
}

.new-save:hover {
    border-color: #999;
    background-color: #f0f0f0;
}

.empty-notice {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.dark .new-save {
    border-color: #444;
    background-color: #222;
}

.dark .new-save:hover {
    border-color: #666;
    background-color: #333;
}

.dark .empty-notice {
    color: #999;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-out {
    animation: fadeOut 0.2s ease-out forwards;
}

.slot-content {
    display: flex;
    flex-grow: 1;
    cursor: pointer;
    align-items: center;
}

.delete-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px;
    color: #999;
    transition: color 0.2s ease;
    margin-left: 10px;
}

.delete-button:hover {
    color: #ff4444;
}

.dark .delete-button {
    color: #666;
}

.dark .delete-button:hover {
    color: #ff6666;
}

/* 新存档按钮不需要删除按钮 */
.new-save .delete-button {
    display: none;
}

/* 背景图 */
.bg {
    visibility: hidden;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* 定义keyframe动画，命名为blink */
@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* 添加兼容性前缀 */
@-webkit-keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@-moz-keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@-ms-keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@-o-keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* 定义blink类*/
.blink {
    /* color: red; */
    /* font-size: 46px; */
    -o-animation: blink 1s linear infinite;
    -webkit-animation: blink 1s linear infinite;
    -moz-animation: blink 1s linear infinite;
    -ms-animation: blink 1s linear infinite;
    animation: blink 1s linear infinite;
}

/* 输入框容器样式 */
#input-container {
    display: flex;
    gap: 10px;
    width: 100%;
    margin: 10px 0;
}

/* 输入框样式 */
#input-box {
    flex: 1;
    padding: 10px;
    font-size: 13pt;
    border: 2px solid #b97c2c;
    border-radius: 4px;
    background: white;
    color: #888;
    font-family: inherit;
}

/* 确定按钮样式 */
#input-submit {
    padding: 10px 20px;
    font-size: 13pt;
    background: #b97c2c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#input-submit:hover {
    background: #a16923;
}

/* 深色主题样式 */
.dark #input-box {
    background: #222;
    border-color: #cc8f1a;
    color: #fff;
}

.dark #input-submit {
    background: #cc8f1a;
}

.dark #input-submit:hover {
    background: #b37d15;
}

#input-box:focus {
    outline: none;
    border-color: #4a3011;
    box-shadow: 0 0 5px rgba(185, 124, 44, 0.5);
}

.dark #input-box:focus {
    border-color: #e6a01c;
    box-shadow: 0 0 5px rgba(204, 143, 26, 0.5);
}

/* === Radar Card (Niky/Gamama) === */
.radar-card{
  --card-bg: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.6));
  --card-bd: rgba(0,0,0,0.6);
  --shadow: 0 10px 30px rgba(0,0,0,0.8);
  --radius: 16px;
  --pad: 16px;
  width: min(100%, 460px);   /* ← 把 92vw 改成 100% */
  margin: 16px auto 8px;
  padding: var(--pad);
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.radar-title{
  font-weight: 700;
  text-align: center;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.radar-note{
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  color: #666;
  opacity: .9;
}

/* SVG inside */
.radar-card svg{
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(40px); /* 向下移动40px */
}
.radar-grid polygon{
  fill: none;
  stroke: rgba(0,0,0,0.8);
  stroke-width: 1;
}
.radar-axis line{
  stroke: rgba(0,0,0,0.5);
  stroke-width: 1;
}
.radar-data polygon{
  fill: rgba(63, 135, 255, 0.8);
  stroke: rgba(63, 135, 255, 0.9);
  stroke-width: 2;
}
.radar-point{
  fill: white;
  stroke: rgba(63, 135, 255, 0.5);
  stroke-width: 2;
}
.radar-label{
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.8);
  stroke-width: 3px;
}
.radar-emoji{
  pointer-events: none;
  /* 不要再有 transform: translate(-50%,-50%); */
  /* 可不设固定 width/height，交给 SVG 属性控制 */
}
@media (min-width: 520px){
  .radar-card{ margin-top: 20px; }
  .radar-label{ font-size: 14px; }
}

/* 成就清单 → 徽章墙：四列网格 + 响应式回退 */
.achv-gallery{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* 一行 4 个 */
  gap: 16px;
}


/* —— 徽章卡片基础 —— */
.achv-badge{
  position: relative;
  display: flex;            /* 横排：icon 左、文右 */
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.55));
  box-shadow: 0 8px 24px rgba(0,0,0,.06), inset 0 0 0 1px rgba(255,255,255,.5);
  border: 1px solid color-mix(in oklab, var(--badge-color, #8b5cf6) 18%, transparent);
  backdrop-filter: blur(6px);
}

/* 竖排“卡片”样（推荐）—— icon 居中在上，文字在下 */
.achv-badge.is-tile{
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
}

/* 奖章（圆环 + 图标）尺寸可调 */
/* 选择类成就：不显示渐变环 */
.badge--choice .badge-ring { display: none; }
.badge-medal{ position: relative; width: 64px; height: 64px; }
.achv-badge.is-tile .badge-medal{ width: 72px; height: 72px; margin-bottom: 6px; }

.badge-ring{
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(
    from 90deg at 50% 50%,
    color-mix(in oklab, var(--badge-color, #8b5cf6) 85%, white) 0 40%,
    color-mix(in oklab, var(--badge-color, #8b5cf6) 65%, black) 40% 80%,
    color-mix(in oklab, var(--badge-color, #8b5cf6) 85%, white) 80% 100%
  );
  mask: radial-gradient(circle at 50% 50%, transparent 52%, black 53%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}

/* 图标盒：以中心为锚点；支持 dx/dy 偏移变量；尺寸可覆盖 */
.badge-icon{
  position: absolute; left: 50%; top: 50%;
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.9);
  box-shadow: 0 2px 6px rgba(0,0,0,.12), inset 0 0 0 1px rgba(0,0,0,.06);
  font-size: 22px;
  pointer-events: none;
  transform:
    translate(
      calc(-50% + var(--icon-dx, 0px)),
      calc(-50% + var(--icon-dy, 0px))
    );
}
.achv-badge.is-tile .badge-icon{ width: 44px; height: 44px; font-size: 24px; }

/* 图片模式 */
.badge-icon[data-mode="img"]{
  background-image: var(--badge-icon, none);
  background-size: 70% 70%;
  background-position: center;
  background-repeat: no-repeat;
}
/* Emoji 模式自动就位 */
.badge-icon[data-mode="emoji"]{ background-image: none; }

/* 文字可通过变量整体改：字号/颜色 */
:root{
  --badge-title-size: 15px; --badge-title-color: #0f172a; /* slate-900 */
  --badge-desc-size: 12px;  --badge-desc-color:  #334155; /* slate-700 */
}
.badge-title{ font-weight: 700; font-size: var(--badge-title-size); color: var(--badge-title-color); line-height: 1.15; }
.badge-desc{  margin-top: 4px; font-size: var(--badge-desc-size);  color: var(--badge-desc-color);  opacity: .9; }

/* 分组主题色（可选：针对战/潜/协做差异化文案颜色） */
.badge--battle  .badge-title{ color: #7f1d1d; }  /* 深红 */
.badge--potential .badge-title{ color: #0c4a6e; }/* 深蓝 */
.badge--harmony .badge-title{ color: #064e3b; }  /* 深绿 */

/* 1) 选择类 & 数值类：都隐藏渐变圆环 */
.badge--choice .badge-ring,
.badge--metric .badge-ring { display: none; }

/* 2) 数值类：去掉小方框，图标更大，留给外挂皮肤做纯图片 */
.badge--metric .badge-icon{
  background: none;         /* 去掉白底 */
  box-shadow: none;         /* 去掉内阴影/描边 */
  border-radius: 0;         /* 不用圆角方块 */
  width: var(--metric-icon-size, 72px);
  height: var(--metric-icon-size, 72px);
}

/* 3) 数值类 + 图片模式：让图片尽量铺满容器 */
.badge--metric .badge-icon[data-mode="img"]{
  background-size: contain;     /* 不裁切，等比缩放 */
  background-position: center;
  background-repeat: no-repeat;
}

/* 4) 可选：数值类的 medal 容器也放大一点，整体更均衡 */
.badge--metric .badge-medal{
  width: calc(var(--metric-icon-size, 72px) + 8px);
  height: calc(var(--metric-icon-size, 72px) + 8px);
}

/* 雷达卡片紧跟在徽章墙后的一点间距（网格外一行） */
.achv-gallery + .radar-card { margin-top: 14px; }

/* 让 SVG 随容器宽度缩放，避免 0 尺寸误会成“没渲染” */
.radar-mount svg { display: block; width: 100%; height: auto; }

/* 成就徽章数值类只放大图标，不改变 tile 高度 */
:root{ --metric-icon-scale: 1.25; }  /* 1.1~1.4 自己调 */

.badge--metric .badge-icon{
  /* 保持原宽高（你的默认 44px/48px 或 72px 取决于你之前的设置）
     如果你之前已经把 .badge--metric .badge-icon 改成使用 --metric-icon-size，
     可以在这里覆盖回固定尺寸，比如：width: 72px; height: 72px; */
}

/* 覆盖 transform：在原本 translate 的基础上叠加 scale */
.badge--metric .badge-icon{
  transform:
    translate(calc(-50% + var(--icon-dx,0px)),
              calc(-50% + var(--icon-dy,0px)))
    scale(var(--metric-icon-scale,1));
  transform-origin: center center;
}

/* === 章节标题造型 === */
.container .chapter-title {
  display: block;
  margin: 24px 0 12px;
  padding: 12px 16px 12px 20px;
  font: 800 20px/1.35 "PingFang SC","Microsoft YaHei",sans-serif;
  letter-spacing: .5px;
  color: #333;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(2px);
}

/* 左侧高亮竖条 */
.container .chapter-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg,#333,#333);
  box-shadow: 0 0 12px rgba(0,0,0,.6);
}

/* ====== 结算颜色（琥珀黄系） ====== */
.settle-panel {
  color: #FFD166;                             /* 文字主色 */
  background: rgba(255, 209, 102, 0.07);      /* 柔和底色，可删 */
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-left: 4px solid rgba(255, 209, 102, 0.85);
  padding: 12px 14px;
  border-radius: 10px;
  margin: 14px 0;
}

/* ====== 成就弹出颜色（青绿系） ====== */
.achv-panel {
  color: #72EAC7;
  background: rgba(114, 234, 199, 0.06);
  border: 1px solid rgba(114, 234, 199, 0.25);
  border-left: 4px solid rgba(114, 234, 199, 0.85);
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0;
}

.hl-red { color:#e03131; font-weight:700; }

/* 隐藏顶部的 “Written in Ink” 字样 */
.written-in-ink {
    display: none !important;
}

/* 只隐藏 Theme（切换主题）按钮 */
#controls #theme-switch {
  display: none !important;
}

/* 防止因为隐藏 Theme 导致“读取进度”后多一个竖线 | */
#controls #reload::after {
  content: "" !important;
}

/* 1) 让雷达卡宽度包含内边距/边框，避免 100% + padding 溢出 */
.radar-card{
  box-sizing: border-box;       /* ← 关键 */
  width: min(100%, 520px);
  margin: 16px auto 8px;        /* 居中 */
}





