* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, "Hiragino Sans", sans-serif; color: #1c1c22; background: #f4f5f8; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid #e3e3ea; }
header h1 { font-size: 16px; margin: 0; }
#meta { font-size: 12px; color: #888; }
.rarity-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px; background: #fff; border-bottom: 1px solid #eee; }
.badge { border: 1px solid #e2e2e8; border-radius: 20px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.badge .c { color: #999; margin-left: 5px; font-size: 11px; }
.badge.on { background: #2d6cdf; color: #fff; border-color: #2d6cdf; }
.badge.on .c { color: #cfe0ff; }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 18px; background: #fafafc; border-bottom: 1px solid #eee; }
.filter-bar input { border: 1px solid #dcdce2; border-radius: 7px; padding: 7px 10px; font-size: 13px; }
.filter-bar .kw { flex: 1; min-width: 240px; }
.tabs { display: flex; gap: 4px; }
.tab { border: 1px solid #ddd; background: #fff; border-radius: 6px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; }
.tab.active { background: #2d6cdf; color: #fff; border-color: #2d6cdf; }
#btn-export { border: 1px solid #ddd; background: #fff; border-radius: 6px; padding: 6px 11px; cursor: pointer; }
#table { margin: 12px 18px; background: #fff; }
.chg-up { color: #1a8f3c; font-weight: 600; }
.chg-dn { color: #c0392b; font-weight: 600; }
.chg-flat { color: #999; }
.thumb { width: 28px; height: 40px; border-radius: 4px; display: inline-block; vertical-align: middle; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.panel { position: fixed; top: 0; right: 0; width: 560px; max-width: 92vw; height: 100%; background: #0f1420; color: #dfe4ee; box-shadow: -8px 0 24px rgba(0,0,0,.3); padding: 20px; z-index: 20; overflow-y: auto; }
.panel.hidden, .overlay.hidden { display: none; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 10; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; }
#panel-close { cursor: pointer; font-size: 18px; color: #8a93a6; }
#panel-price { font-size: 24px; font-weight: 700; margin: 12px 0; }
.ranges { display: flex; gap: 6px; margin-bottom: 12px; }
.rng { background: transparent; color: #8a93a6; border: none; padding: 3px 9px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.rng.active { background: #2d6cdf; color: #fff; }
.panel-stats { display: flex; justify-content: space-between; font-size: 11px; color: #8a93a6; margin-top: 8px; }
.thumb { object-fit: contain; background: #f0f0f3; }
.panel-title-row { display: flex; gap: 12px; align-items: flex-start; }
.panel-img { width: 120px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 12px; padding: 20px; width: 340px; max-width: 92vw; display: flex; flex-direction: column; gap: 10px; }
.modal-head { display: flex; justify-content: space-between; font-weight: 600; }
.modal-box input { border: 1px solid #dcdce2; border-radius: 7px; padding: 8px 10px; font-size: 14px; }
.modal-box label { font-size: 12px; color: #777; }
.modal-box button { background: #2d6cdf; color: #fff; border: none; border-radius: 7px; padding: 9px; cursor: pointer; font-size: 14px; }
.modal-head span:last-child { cursor: pointer; color: #999; }
.auth-error { color: #c0392b; font-size: 12px; min-height: 14px; }
.auth-switch { font-size: 12px; text-align: center; }
.main-nav { display: flex; gap: 6px; padding: 8px 18px; background: #fff; border-bottom: 1px solid #eee; }
.mtab { border: none; background: transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #555; }
.mtab.active { background: #1c1c22; color: #fff; }
.mtab.hidden { display: none; }
.view { padding: 16px 18px; }
.view.hidden { display: none; }
#auth-area a, #auth-area button { cursor: pointer; }
.portfolio-cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pcard { background: #fff; border: 1px solid #e3e3ea; border-radius: 10px; padding: 14px 18px; min-width: 160px; }
.pcard .label { font-size: 11px; color: #888; text-transform: uppercase; }
.pcard .big { font-size: 22px; font-weight: 700; margin-top: 4px; }
.filter-bar.hidden, #table.hidden, #rarity-bar.hidden { display: none; }
.row-act { cursor: pointer; margin-right: 6px; font-size: 14px; }
.img-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 50; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.img-lightbox.hidden { display: none; }
.img-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
img.thumb { cursor: zoom-in; }
.imp-block { margin-top: 10px; }
.imp-h { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th, .imp-table td { border-bottom: 1px solid #eee; padding: 4px 6px; text-align: left; }
.nf-row { cursor: pointer; }
.nf-row:hover { background: #eef4ff; }
.imp-amb { margin-top: 8px; }
.imp-add { cursor: pointer; border: 1px solid #2d6cdf; color: #2d6cdf; background: #fff; border-radius: 6px; padding: 2px 8px; }
#import-done { cursor: pointer; border: 1px solid #1a8f3c; color: #1a8f3c; background: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12.5px; }

.batch-bar { margin: 8px 0; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.batch-bar button { border: 1px solid #ddd; background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.sel-box { cursor: pointer; }
#game-switch { margin-right: 10px; }
.gbtn { border: 1px solid #ddd; background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.gbtn.active { background: #1c1c22; color: #fff; border-color: #1c1c22; }
.pmode { border: 1px solid #ddd; background: #fff; border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 12px; margin-right: 4px; }
.pmode.active { background: #2d6cdf; color: #fff; border-color: #2d6cdf; }
