@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

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

:root {
  --ink: #1a1d26;
  --ink-secondary: #3d4155;
  --stone-600: #6b7084;
  --stone-400: #9da1b4;
  --stone-200: #d8dae2;
  --stone-100: #eef0f4;
  --stone-50: #f6f7f9;
  --white: #ffffff;
  --accent: #2d5be3;
  --accent-hover: #1e3fa6;
  --accent-subtle: #edf1fd;
  --success: #1a9a6c;
  --warning-text: #8a6100;
  --warning-bg: #fef7e6;
  --warning-border: #f0d68a;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'SF Mono', 'Cascadia Mono', 'Consolas', monospace;
  --radius: 6px;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--stone-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Logotype ---- */
.logo {
  display: flex;
  align-items: baseline;
  text-decoration: none;
  gap: 0;
}
.logo-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-dot {
  color: var(--accent);
}

/* ---- Navigation ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  border-bottom: 1px solid var(--stone-200);
  background: var(--white);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding-left: 12px;
  border-left: 1px solid var(--stone-200);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--stone-600);
}
.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.nav-link:hover { text-decoration: underline; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--white);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }

.btn-ghost {
  background: none;
  color: var(--accent);
  border: 1px solid var(--stone-200);
}
.btn-ghost:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

/* ---- Homepage ---- */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px;
}
.search-box {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.15s;
}
.search-box::placeholder { color: var(--stone-400); }
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

.doc-list { display: flex; flex-direction: column; gap: 1px; }

.doc-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--white);
  text-decoration: none;
  color: inherit;
  gap: 12px;
  transition: background 0.12s;
}
.doc-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.doc-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.doc-item:only-child { border-radius: var(--radius); }
.doc-item:hover { background: var(--accent-subtle); }

.doc-format {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
}
.doc-format.html { color: var(--accent); background: var(--accent-subtle); }
.doc-format.md { color: var(--success); background: #edf8f3; }

.doc-info { flex: 1; min-width: 0; }
.doc-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-meta { font-size: 12px; color: var(--stone-600); margin-top: 1px; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.pagination a:hover { text-decoration: underline; }

/* Empty state */
.empty {
  text-align: center;
  padding: 64px 20px;
}
.empty-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-text {
  font-size: 13px;
  color: var(--stone-600);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 20px;
}

/* ---- Tabs ---- */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--stone-200);
}
.tab {
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--stone-600);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Drop zone ---- */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  border: 2px dashed var(--stone-200);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.drop-zone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: #edf8f3;
}
.file-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}
.drop-icon {
  font-size: 24px;
  font-weight: 300;
  color: var(--stone-400);
  line-height: 1;
}
.drop-zone.has-file .drop-icon { color: var(--success); }
.drop-text {
  font-size: 14px;
  color: var(--ink-secondary);
}
.drop-hint {
  font-size: 12px;
  color: var(--stone-400);
}
.drop-zone.has-file .drop-hint { display: none; }

/* ---- Upload form ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 12px;
  color: var(--stone-600);
  font-weight: 400;
  margin-left: 4px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.form-textarea {
  min-height: 220px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.form-select {
  padding: 10px 14px;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}
.form-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-secondary);
  cursor: pointer;
}
.form-error {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #991b1b;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ---- Viewer ---- */
.viewer-frame {
  width: 100%;
  height: calc(100vh - 48px);
  border: none;
}

/* ---- Confirmation ---- */
.confirm {
  max-width: 480px;
  margin: 72px auto 40px;
  padding: 0 20px;
}
.confirm-card {
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: 10px;
  padding: 32px 28px;
}
.confirm-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.confirm-url {
  font-size: 14px;
  margin-bottom: 24px;
}
.confirm-url a {
  color: var(--accent);
  word-break: break-all;
  text-decoration: none;
}
.confirm-url a:hover { text-decoration: underline; }

.secret-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.secret-box {
  padding: 12px 14px;
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-secondary);
  word-break: break-all;
  line-height: 1.5;
}
.secret-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.copy-btn {
  background: var(--stone-100);
  border: 1px solid var(--stone-200);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.copy-btn:hover { background: var(--stone-200); border-color: var(--stone-400); }

.secret-warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--warning-text);
  line-height: 1.5;
}

.confirm-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

/* ---- Page heading ---- */
.page-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
}
