/* =========================================================================
   MC 成就生成器（加载顺序 mc-gui.css → achievement-tool.css）
   ========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 15px 40px; background: rgba(10, 10, 21, .8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(102, 126, 234, .15); line-height: 1.5;
}
.header-content { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-menu { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-item-dropdown, .user-dropdown, .settings-menu { position: relative; }
.nav-item { display: flex; align-items: center; gap: 6px; }
.nav-item i { font-size: 10px; transition: transform .3s ease; color: #a5b4fc; }
.nav-item-dropdown:hover .nav-item i { transform: rotate(180deg); }
.nav-link { padding: 10px 20px; color: rgba(255,255,255,.8); text-decoration: none; font-weight: 500; transition: all .3s ease; border-radius: 8px; white-space: nowrap; }
.nav-link:hover { color: #667eea; background: rgba(102,126,234,.1); }
.dropdown-menu { position: absolute; top: 100%; left: 0; margin-top: 10px; background: rgba(15,23,42,.98); backdrop-filter: blur(20px); border: 1px solid rgba(102,126,234,.2); border-radius: 12px; padding: 8px; min-width: 220px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all .3s ease; box-shadow: 0 20px 40px rgba(0,0,0,.5); z-index: 100; }
.nav-item-dropdown:hover .dropdown-menu, .user-dropdown:hover .dropdown-menu, .settings-menu:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { display: block; padding: 10px 14px; color: rgba(226,232,240,.8); text-decoration: none; border-radius: 8px; transition: all .2s ease; font-size: 14px; }
.dropdown-menu a:hover { background: rgba(102,126,234,.15); color: #a5b4fc; }
.user-dropdown-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(102,126,234,.1); border: 1px solid rgba(102,126,234,.2); border-radius: 10px; text-decoration: none; color: #e0e7ff; transition: all .3s ease; }
.settings-menu > a { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; background: rgba(102,126,234,.1); border: 1px solid rgba(102,126,234,.2); border-radius: 10px; color: #a5b4fc; text-decoration: none; }
.settings-menu .dropdown-menu, .user-dropdown .dropdown-menu { right: 0; left: auto; }
.header-right { display: flex; align-items: center; gap: 16px; }
.logo img { height: 38px; width: auto; }
#auth-buttons { display: flex; align-items: center; gap: 10px; }
.btn-login, .btn-register, .btn-secondary, .btn-primary { padding: 10px 22px; font-size: 14px; border-radius: 50px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; transition: all .3s ease; border: none; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); color: #fff; box-shadow: 0 4px 20px rgba(102,126,234,.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(102,126,234,.5); }
.btn-secondary { background: rgba(102,126,234,.15); border: 1px solid rgba(102,126,234,.3); color: #a5b4fc; }

.footer { background: rgba(10,10,21,.7); border-top: 1px solid rgba(102,126,234,.15); padding: 60px 20px 40px; margin-top: 60px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 50px; margin-bottom: 40px; }
.footer-brand h3 { font-size: 22px; font-weight: 700; margin-bottom: 14px; color: #e0e7ff; }
.footer-brand p { color: #cbd5e1; line-height: 1.6; font-size: 14px; }
.footer-links h4 { font-size: 12px; font-weight: 700; margin-bottom: 16px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #cbd5e1; text-decoration: none; font-size: 14px; transition: all .3s ease; }
.footer-links a:hover { color: #818cf8; }

/* ---------------------------------------------------------- 主体 */
body { background: #0b1120; color: #e2e8f0; font-family: system-ui,-apple-system,'Segoe UI','Microsoft YaHei',sans-serif; }
.ach-main { padding: 120px 20px 40px; max-width: 1240px; margin: 0 auto; position: relative; z-index: 1; }

.ach-hero { margin-bottom: 22px; }
.ach-hero h1 { font-size: 27px; font-weight: 800; color: #e0e7ff; display: flex; align-items: center; gap: 10px; }
.ach-hero h1 i { color: #a5b4fc; }
.ach-hero p { color: #94a3b8; font-size: 14px; margin-top: 8px; max-width: 760px; line-height: 1.75; }

.ach-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ach-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.ach-panel { background: rgba(15,23,42,.86); border: 1px solid rgba(102,126,234,.2); border-radius: 16px; padding: 20px; }
.ach-panel h2 { font-size: 14px; font-weight: 800; color: #c7d2fe; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.ach-panel h2 i { color: #818cf8; font-size: 15px; }
.ach-sticky { position: sticky; top: 118px; }

.ach-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.ach-field > span { font-size: 12.5px; color: #94a3b8; font-weight: 600; }
.ach-field > span i { color: #f87171; font-style: normal; margin-left: 3px; }
.ach-field input, .ach-field select, .ach-field textarea {
  background: rgba(2,6,23,.72); border: 1px solid rgba(102,126,234,.25); color: #e2e8f0;
  border-radius: 10px; padding: 10px 13px; font-size: 13.5px; outline: none; width: 100%;
  font-family: inherit; transition: border-color .2s ease;
}
.ach-field input:focus, .ach-field select:focus, .ach-field textarea:focus { border-color: rgba(102,126,234,.7); }
.ach-field textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; }
.ach-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ach-switches { display: flex; flex-direction: column; gap: 10px; }
.ach-switch { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #cbd5e1; cursor: pointer; user-select: none; }
.ach-switch input { width: 16px; height: 16px; accent-color: #818cf8; cursor: pointer; }
.ach-note { font-size: 12px; color: #64748b; line-height: 1.75; margin-top: 6px; }
.ach-note code, .ach-steps code { background: rgba(102,126,234,.14); color: #a5b4fc; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* ---------------- 预览 ---------------- */
.ach-preview {
  padding: 26px 18px; border-radius: 12px; margin-bottom: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(99,102,241,.18), rgba(2,6,23,.9) 70%);
  border: 1px solid rgba(102,126,234,.18);
  display: flex; justify-content: center;
}
.ach-toast {
  display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 100%;
  padding: 10px 14px; background: #212121; border: 2px solid #4a4a4a; border-radius: 3px;
  box-shadow: inset 0 0 0 2px #101010, 0 8px 22px rgba(0,0,0,.55);
  image-rendering: pixelated;
}
.ach-icon {
  width: 34px; height: 34px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#3a3a3a,#1d1d1d); border: 2px solid #5a5a5a; border-radius: 2px;
  font-size: 11px; font-weight: 800; color: #d8d8d8; letter-spacing: -.5px; text-transform: uppercase;
}
.ach-icon.goal { border-color: #e0b34a; }
.ach-icon.challenge { border-color: #b46ce0; }
.ach-text { min-width: 0; }
.ach-title { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.35; word-break: break-word; }
.ach-title.goal { color: #ffd75e; }
.ach-title.challenge { color: #d77bff; }
.ach-desc { font-size: 12px; color: #a8a8a8; line-height: 1.4; margin-top: 2px; word-break: break-word; }

.ach-tree {
  padding: 18px; border-radius: 12px; background: rgba(2,6,23,.7);
  border: 1px solid rgba(102,126,234,.16); display: flex; justify-content: center;
}
.ach-node { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.ach-node-box {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: #2b2b2b; border: 2px solid #6d6d6d; border-radius: 3px;
  font-size: 13px; font-weight: 800; color: #cfcfcf; text-transform: uppercase;
}
.ach-node-box.goal { border-color: #e0b34a; box-shadow: 0 0 12px rgba(224,179,74,.35); }
.ach-node-box.challenge { border-color: #b46ce0; box-shadow: 0 0 12px rgba(180,108,224,.35); }
.ach-node-label { font-size: 12px; color: #cbd5e1; text-align: center; max-width: 120px; }
.ach-node-label.goal { color: #ffd75e; }
.ach-node-label.challenge { color: #d77bff; }

.ach-code {
  max-height: 320px; overflow: auto; padding: 14px; border-radius: 12px;
  background: rgba(2,6,23,.85); border: 1px solid rgba(102,126,234,.18);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.65;
  color: #cbd5e1; white-space: pre; tab-size: 2;
}

.ach-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ach-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(102,126,234,.28); background: rgba(102,126,234,.14); color: #c7d2fe; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .2s ease; }
.ach-btn:hover { background: rgba(102,126,234,.25); color: #fff; }
.ach-btn.primary { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); color: #fff; border: none; box-shadow: 0 4px 18px rgba(102,126,234,.35); }
.ach-btn.primary:hover { transform: translateY(-2px); }
.ach-btn.ghost { background: transparent; color: #94a3b8; }
.ach-msg { font-size: 13px; padding: 10px 14px; border-radius: 10px; display: none; margin-top: 12px; }
.ach-msg.ok { display: block; background: rgba(34,197,94,.14); color: #86efac; border: 1px solid rgba(34,197,94,.35); }
.ach-msg.err { display: block; background: rgba(239,68,68,.14); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }

.ach-steps { padding-left: 20px; }
.ach-steps li { color: #cbd5e1; font-size: 13px; line-height: 1.9; margin-bottom: 4px; }

@media (max-width: 980px) {
  .ach-layout { grid-template-columns: 1fr; }
  .ach-sticky { position: static; }
  .ach-main { padding: 108px 14px 30px; }
  .ach-row2 { grid-template-columns: 1fr; }
}
