:root {
  --ink: #1b2430;
  --muted: #6b7788;
  --line: #e4eaf1;
  --paper: #eef3f8;
  --card: #ffffff;
  --accent: #2b8a3e;
  --accent-deep: #237032;
  --accent-soft: rgba(43, 138, 62, 0.12);
  --shadow: 0 18px 50px rgba(28, 48, 74, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(820px 380px at 8% -8%, rgba(43, 138, 62, 0.16), transparent 62%),
    radial-gradient(680px 320px at 100% 0%, rgba(59, 91, 219, 0.1), transparent 58%),
    linear-gradient(180deg, #f7faf7 0%, var(--paper) 100%);
}

.page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(160deg, #40c057, var(--accent-deep));
  box-shadow: 0 10px 20px rgba(43, 138, 62, 0.28);
}

.brand h1 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0.2px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.nav a:hover {
  color: var(--accent-deep);
  background: #fff;
  box-shadow: 0 6px 16px rgba(28, 48, 74, 0.08);
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  display: block;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.field-actions .btn {
  min-width: 108px;
}

textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea:focus {
  border-color: #b2e0bc;
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #3d4a5c;
  background: #f7f9fc;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: #eef2f7;
  border-color: #c5d0de;
}

.btn:active {
  transform: translateY(1px);
}

.btn.file {
  color: #334155;
  background: #f4f6f8;
  border-color: #d5dbe3;
}

.btn.file:hover {
  background: #e9edf2;
}

.btn.primary {
  margin-left: auto;
  padding: 12px 22px;
  border: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(43, 138, 62, 0.32);
}

.btn.primary:hover {
  color: #fff;
  background: var(--accent-deep);
  border-color: transparent;
}

.btn.format {
  color: #3b5bdb;
  background: #f3f5ff;
  border-color: #d5dcf8;
}

.btn.format:hover {
  color: #364fc7;
  background: #e8ecff;
  border-color: #c5cef3;
}

.btn.compress {
  color: #0c8599;
  background: #f2fbfc;
  border-color: #c9e7ec;
}

.btn.compress:hover {
  color: #0b7285;
  background: #e6f6f8;
  border-color: #b5dce3;
}

.btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 24px, 860px);
    padding-top: 24px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 22px;
  }

  .card {
    padding: 18px;
  }

  .toolbar .btn {
    flex: 1 1 140px;
  }

  .file-name {
    flex: 1 1 100%;
  }
}
